(table, colIndex)
| 301 | } |
| 302 | |
| 303 | function addColumnLeft(table, colIndex) { |
| 304 | Array.from(table.rows).forEach((row, rowIdx) => { |
| 305 | const cell = row.insertCell(colIndex); |
| 306 | if (rowIdx === 0 && row.children[colIndex + 1] && row.children[colIndex + 1].tagName === 'TH') { |
| 307 | const th = document.createElement('th'); |
| 308 | th.style.cssText = 'padding: 12px; border: 1px solid #e5e7eb; background: #f8fafc; font-weight: 600; text-align: left; color: #374151;'; |
| 309 | th.textContent = '新列'; |
| 310 | row.replaceChild(th, cell); |
| 311 | } else { |
| 312 | cell.style.cssText = 'padding: 12px; border: 1px solid #e5e7eb; color: #374151; min-height: 20px;'; |
| 313 | } |
| 314 | }); |
| 315 | } |
| 316 | |
| 317 | function addColumnRight(table, colIndex) { |
| 318 | Array.from(table.rows).forEach((row, rowIdx) => { |
no outgoing calls
no test coverage detected