Skip to content

Type Editor


Type Editor / @type-editor/tables / commands/add-row / addRow

Function: addRow()

ts
function addRow(transaction, tableRect, row): PmTransaction;

Defined in: tables/src/commands/add-row.ts:23

Adds a row at the given position in a table.

This function handles:

  • Extending cells that span across the insertion point via rowspan
  • 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
rownumberThe row index where the new row should be inserted

Returns

PmTransaction

The modified transaction