Skip to content
GitHubDiscord

prosekit/extensions/table

row: number

The number of rows in the table.

col: number

The number of columns in the table.

header?: boolean

Whether the table has a header row.

false


anchor?: number

A hit position of the table cell to select from. By default, the selection anchor will be used.

head?: number

A hit position of the table cell to select to. By default, the selection head will be used.


anchor?: number

A hit position of the table cell to select from. By default, the selection anchor will be used.

head?: number

A hit position of the table cell to select to. By default, the selection head will be used.


pos?: number

A hit position of the table cell to select from. By default, the selection anchor will be used.


pos?: number

A hit position of the table to select from. By default, the selection anchor will be used.


Options for moveTableColumn

from: number

The source column index to move from.

to: number

The destination column index to move to.

select?: boolean

Whether to select the moved column after the operation.

true

pos?: number

Optional position to resolve table from. If not provided, uses the current selection.


Options for moveTableRow

from: number

The source row index to move from.

to: number

The destination row index to move to.

select?: boolean

Whether to select the moved row after the operation.

true

pos?: number

Optional position to resolve table from. If not provided, uses the current selection.

const exitTable: Command

When the selection is in a table node, create a default block after the table table, and move the cursor there.

function insertTable(options: InsertTableOptions): Command

Insert a table node with the given number of rows and columns, and optionally a header row.


function selectTableColumn(options?: SelectTableColumnOptions): Command


function selectTableRow(options?: SelectTableRowOptions): Command


function selectTableCell(options?: SelectTableCellOptions): Command


function selectTable(options?: SelectTableOptions): Command


function defineTableCommands(): TableCommandsExtension

Adds commands for working with table nodes.


function moveTableColumn(options: MoveTableColumnOptions): Command

Move a table column from index origin to index target.


function moveTableRow(options: MoveTableRowOptions): Command

Move a table row from index origin to index target.


function defineTablePlugins(): PlainExtension


function defineTableHeaderCellSpec(): TableHeaderCellSpecExtension


function isCellSelection(value: unknown): value is CellSelection

Checks if the given object is a CellSelection instance.


function defineTable(): TableExtension