Skip to content

prosekit/extensions/table

InsertTableOptions

col: number

header: boolean

row: number

SelectTableCellOptions

pos?: number

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

SelectTableColumnOptions

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.

SelectTableOptions

pos?: number

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

SelectTableRowOptions

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.

defineTable

ts
function defineTable(): TableExtension

defineTableCommands

ts
function defineTableCommands(): TableCommandsExtension

Adds commands for working with table nodes.

defineTableHeaderCellSpec

ts
function defineTableHeaderCellSpec(): TableHeaderCellSpecExtension

defineTablePlugins

ts
function defineTablePlugins(): PlainExtension

exitTable

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

ts
function exitTable(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean

insertTable

ts
function insertTable(options: InsertTableOptions): Command

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

isCellSelection

ts
function isCellSelection(value: unknown): value is CellSelection

Checks if the given object is a CellSelection instance.

selectTable

ts
function selectTable(options?: SelectTableOptions): Command

selectTableCell

ts
function selectTableCell(options?: SelectTableCellOptions): Command

selectTableColumn

ts
function selectTableColumn(options?: SelectTableColumnOptions): Command

selectTableRow

ts
function selectTableRow(options?: SelectTableRowOptions): Command