Skip to content

Type Editor


Type Editor / @type-editor/tables / commands/add-column / addColumn

Function: addColumn()

ts
function addColumn(transaction, tableRect, col): PmTransaction;

Defined in: tables/src/commands/add-column.ts:25

Adds a column at the given position in a table.

This function handles:

  • Extending cells that span across the insertion point
  • Creating new cells with the appropriate type (header or regular)
  • Maintaining table structure integrity

Parameters

ParameterTypeDescription
transactionPmTransactionThe transaction to apply changes to
tableRectTableRectThe table rectangle containing map, tableStart, and table
colnumberThe column index where the new column should be inserted

Returns

PmTransaction

The modified transaction