MCPcopy Create free account
hub / github.com/dajie111/nodeseek-userscript / addColumnLeft

Function addColumnLeft

notes.js:303–315  ·  view source on GitHub ↗
(table, colIndex)

Source from the content-addressed store, hash-verified

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) => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected