Skip to main content
Create structured data with full Word table compatibility. Professional tables with merge/split capabilities, preserving all formatting through Word import/export.

OOXML Structure

<w:tbl>
  <w:tblPr>
    <w:tblBorders>
      <w:top w:val="single" w:sz="4"/>
      <w:left w:val="single" w:sz="4"/>
      <w:bottom w:val="single" w:sz="4"/>
      <w:right w:val="single" w:sz="4"/>
      <w:insideH w:val="single" w:sz="4"/>
      <w:insideV w:val="single" w:sz="4"/>
    </w:tblBorders>
  </w:tblPr>
  <w:tr>
    <w:tc>
      <w:tcPr>
        <w:tcW w:w="2880" w:type="dxa"/>
      </w:tcPr>
      <w:p><w:r><w:t>Cell content</w:t></w:r></w:p>
    </w:tc>
  </w:tr>
</w:tbl>

Use Case

  • Financial reports - Quarterly data with totals
  • Comparison matrices - Feature/pricing tables
  • Schedules - Time-based planning with merged headers
  • Data organization - Structured content that needs alignment
  • Complex layouts - Merged cells for sophisticated designs

Options

Configure the extension behavior:
htmlAttributes
Object
default:"{'aria-label':'Table node'}"
Default HTML attributes for all tables
resizable
boolean
default:"true"
Enable column resizing functionality
handleWidth
number
default:"5"
Width of resize handles in pixels
cellMinWidth
number
default:"10"
Minimum cell width constraint in pixels
lastColumnResizable
boolean
default:"true"
Allow resizing of the last column
allowTableNodeSelection
boolean
default:"false"
Enable selecting the entire table node

Attributes

Node attributes that can be set and retrieved:
tableIndent
TableIndent
Table indentation configuration
borders
any
required
Border styling for this table
borderCollapse
string
default:"collapse"
CSS border-collapse property
justification
string
Table alignment (‘left’, ‘center’, ‘right’)
tableCellSpacing
number
Cell spacing in pixels for this table

Commands

insertTable

Insert a new table into the document Example:
editor.commands.insertTable()
editor.commands.insertTable({ rows: 3, cols: 3, withHeaderRow: true })
Parameters:
config
TableConfig
required
Table configuration options

deleteTable

Delete the entire table containing the cursor Example:
editor.commands.deleteTable()

addColumnBefore

Add a column before the current column
Preserves cell attributes from current column
Example:
editor.commands.addColumnBefore()

addColumnAfter

Add a column after the current column
Preserves cell attributes from current column
Example:
editor.commands.addColumnAfter()
Returns: Function Command

deleteColumn

Delete the column containing the cursor Example:
editor.commands.deleteColumn()
Returns: Function Command

addRowBefore

Add a row before the current row
Preserves cell attributes from current row
Example:
editor.commands.addRowBefore()
Returns: Function Command

addRowAfter

Add a row after the current row
Preserves cell attributes from current row
Example:
editor.commands.addRowAfter()
Returns: Function Command

deleteRow

Delete the row containing the cursor Example:
editor.commands.deleteRow()
Returns: Function Command

mergeCells

Merge selected cells into one
Content from all cells is preserved
Example:
editor.commands.mergeCells()
Returns: Function Command

splitCell

Split a merged cell back into individual cells Example:
editor.commands.splitCell()
Returns: Function Command - true if split, false if position invalid

splitSingleCell

Split a single unmerged cell into two cells horizontally
Different from splitCell which splits merged cells back to original cells
Example:
editor.commands.splitSingleCell()
Returns: Function Command - true if split, false if position invalid

mergeOrSplit

Toggle between merge and split cells based on selection
Merges if multiple cells selected, splits if merged cell selected
Example:
editor.commands.mergeOrSplit()
Returns: Function Command

toggleHeaderColumn

Toggle the first column as header column Example:
editor.commands.toggleHeaderColumn()
Returns: Function Command

toggleHeaderRow

Toggle the first row as header row Example:
editor.commands.toggleHeaderRow()
Returns: Function Command

toggleHeaderCell

Toggle current cell as header cell Example:
editor.commands.toggleHeaderCell()
Returns: Function Command

setCellAttr

Set an attribute on selected cells Example:
editor.commands.setCellAttr('background', { color: 'ff0000' })
setCellAttr('verticalAlign', 'middle')
Parameters:
name
string
required
Attribute name
value
any
required
Attribute value
Returns: Function Command

goToNextCell

Navigate to the next cell (Tab behavior) Example:
editor.commands.goToNextCell()
Returns: Function Command

goToPreviousCell

Navigate to the previous cell (Shift+Tab behavior) Example:
editor.commands.goToPreviousCell()
Returns: Function Command

fixTables

Fix table structure inconsistencies
Repairs malformed tables and normalizes structure
Example:
editor.commands.fixTables()
Returns: Function Command

setCellSelection

Set cell selection programmatically Example:
editor.commands.setCellSelection({ anchorCell: 10, headCell: 15 })
Parameters:
pos
CellSelectionPosition
required
Cell selection coordinates
Returns: Function Command

setCellBackground

Set background color for selected cells Example:
editor.commands.setCellBackground('#ff0000')
editor.commands.setCellBackground('ff0000')
Parameters:
value
string
required
Color value (hex with or without #)

deleteCellAndTableBorders

Remove all borders from table and its cells
Sets all border sizes to 0
Example:
editor.commands.deleteCellAndTableBorders()
Returns: Function Command

Keyboard Shortcuts

CommandShortcutDescription
goToNextCell/addRowAfter()TabNavigate to next cell or add row
goToPreviousCell()Shift-TabNavigate to previous cell
deleteTableWhenSelected()BackspaceDelete table when all cells selected
deleteTableWhenSelected()DeleteDelete table when all cells selected

Types

ThemeColor

Theme color options

ShadingPattern

Shading pattern options

ShadingProperties

Shading properties

TableMeasurement

Table width options

TableLook

Table look options

FloatingTableProperties

Floating table properties

TableBorderSpec

Table border specification

TableBorders

Table borders properties

TableBorders

Table borders object

TableCellMargins

Table cell margin properties

TableProperties

Table properties

ColWidth

Column width definition

TableGrid

Table grid definition

TableConfig

Table configuration options

TableIndent

Table indentation configuration

CellSelectionPosition

Cell selection position

CurrentCellInfo

Current cell information

CellBorder

Cell border configuration

CellBorders

Cell borders object

TableBorder

Table border configuration

BorderOptions

Border creation options

Source Code

I