Skip to content

prosekit/extensions/table

InsertTableOptions

Properties

col

col: number

header: boolean

row

row: number


SelectTableCellOptions

Properties

pos?

optional pos: number

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


SelectTableColumnOptions

Properties

anchor?

optional anchor: number

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

optional head: number

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


SelectTableOptions

Properties

pos?

optional pos: number

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


SelectTableRowOptions

Properties

anchor?

optional anchor: number

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

head?

optional head: number

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


defineTable()

defineTable(): TableExtension

Returns

TableExtension


defineTableCommands()

defineTableCommands(): TableCommandsExtension

Adds commands for working with table nodes.

Returns

TableCommandsExtension


defineTableHeaderCellSpec()

defineTableHeaderCellSpec(): TableHeaderCellSpecExtension

Returns

TableHeaderCellSpecExtension


defineTablePlugins()

defineTablePlugins(): PlainExtension

Returns

PlainExtension


exitTable()

exitTable(state, dispatch?, view?): boolean

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

Parameters

state: EditorState

dispatch?

view?: EditorView

Returns

boolean


insertTable()

insertTable(options): Command

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

Parameters

options: InsertTableOptions

Returns

Command


isCellSelection()

isCellSelection(value): value is CellSelection

Checks if the given object is a CellSelection instance.

Parameters

value: unknown

Returns

value is CellSelection


selectTable()

selectTable(options?): Command

Parameters

options?: SelectTableOptions

Returns

Command


selectTableCell()

selectTableCell(options?): Command

Parameters

options?: SelectTableCellOptions

Returns

Command


selectTableColumn()

selectTableColumn(options?): Command

Parameters

options?: SelectTableColumnOptions

Returns

Command


selectTableRow()

selectTableRow(options?): Command

Parameters

options?: SelectTableRowOptions

Returns

Command