Class: TableNode

A Lexical node that represents a markdown table. Use "$createTableNode" to construct one.

Hierarchy

  • DecoratorNode<JSX.Element>

    TableNode

Table of contents

Constructors

Methods

Constructors

constructor

new TableNode(mdastNode?, key?): TableNode

Constructs a new TableNode with the specified MDAST table node as the object to edit. See micromark/micromark-extension-gfm-table for more information on the MDAST table node.

Parameters

NameType
mdastNode?Table
key?string

Returns

TableNode

Overrides

DecoratorNode&lt;JSX.Element&gt;.constructor

Methods

addColumnToRight

addColumnToRight(): void

Returns

void


addRowToBottom

addRowToBottom(): void

Returns

void


deleteColumnAt

deleteColumnAt(colIndex): void

Parameters

NameType
colIndexnumber

Returns

void


deleteRowAt

deleteRowAt(rowIndex): void

Parameters

NameType
rowIndexnumber

Returns

void


getColCount

getColCount(): number

Returns the number of columns in the table.

Returns

number


getMdastNode

getMdastNode(): Table

Returns the mdast node that this node is constructed from.

Returns

Table


getRowCount

getRowCount(): number

Returns the number of rows in the table.

Returns

number


insertColumnAt

insertColumnAt(colIndex): void

Parameters

NameType
colIndexnumber

Returns

void


insertRowAt

insertRowAt(y): void

Parameters

NameType
ynumber

Returns

void


select

select(coords?): void

Focuses the table cell at the specified coordinates. Pass undefined to remove the focus.

Parameters

NameType
coords?[colIndex: number, rowIndex: number]

Returns

void


setColumnAlign

setColumnAlign(colIndex, align): void

Parameters

NameType
colIndexnumber
alignAlignType

Returns

void