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
| Parameter | Type | Description |
|---|---|---|
transaction | PmTransaction | The transaction to apply changes to |
tableRect | TableRect | The table rectangle containing map, tableStart, and table |
col | number | The column index where the new column should be inserted |
Returns
PmTransaction
The modified transaction