MCPcopy
hub / github.com/exceljs/exceljs / addColumn

Method addColumn

lib/doc/table.js:359–375  ·  view source on GitHub ↗
(column, values, colIndex)

Source from the content-addressed store, hash-verified

357 }
358
359 addColumn(column, values, colIndex) {
360 // Add a new column, including column defn and values
361 // Inserts at colNumber or adds to the right
362 this.cacheState();
363
364 if (colIndex === undefined) {
365 this.table.columns.push(column);
366 this.table.rows.forEach((row, i) => {
367 row.push(values[i]);
368 });
369 } else {
370 this.table.columns.splice(colIndex, 0, column);
371 this.table.rows.forEach((row, i) => {
372 row.splice(colIndex, 0, values[i]);
373 });
374 }
375 }
376
377 removeColumns(colIndex, count = 1) {
378 // Remove a column with data

Callers 4

anchor.spec.jsFile · 0.80
column.spec.jsFile · 0.80
row.spec.jsFile · 0.80

Calls 4

cacheStateMethod · 0.95
forEachMethod · 0.65
spliceMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected