Typix LogoTypix
Extensions

Table

Tables with rows, columns, merging, resizing, and frozen headers

Full table support: insert N×M tables, merge/split cells, resize columns with drag handles, freeze the header row, color rows/columns/cells, and duplicate/clear/delete via commands.

Install

pnpm add @typix-editor/extension-table

Live demo

Insert a table

editor.chain().insertTable({ rows: 3, columns: 3, includeHeaders: true }).run();

Commands

The extension ships ~20 commands for table manipulation:

CommandPurpose
TYPIX_INSERT_TABLEInsert a new table at the selection.
TYPIX_INSERT_ROW_ABOVE / _BELOWAdd a row.
TYPIX_INSERT_COLUMN_LEFT / _RIGHTAdd a column.
TYPIX_DELETE_ROW / _COLUMN / _TABLERemove.
TYPIX_UNMERGE_CELLSSplit previously-merged cells.
TYPIX_TOGGLE_HEADER_ROW / _COLUMNToggle header on the first row/column.
TYPIX_CLEAR_CELL_CONTENTS / _ROW_ / _COLUMN_Clear without deleting.
TYPIX_DUPLICATE_ROW / _COLUMNDuplicate.
TYPIX_SET_CELL_BACKGROUND_COLORColor a single cell.
TYPIX_SET_ROW_BACKGROUND_COLOR / _COLUMN_Color a row or column.

All importable from @typix-editor/extension-table. Dispatch via editor.lexical.dispatchCommand(CMD, payload).

Vendor the UI

npx typix ui add table

Helpers

import {
  TableUI,
  TableCellResizer,
  type TableHoverInfo,
} from "@/components/typix/main/table";
  • TableUI — full table UI (cell menu, header buttons, color picker)
  • TableCellResizer — just the resize handles

On this page