Skip to content

Type Editor


Type Editor / @type-editor/tables / commands/toggle-header

commands/toggle-header

Functions

FunctionDescription

toggleHeader

Toggles between row/column header and normal cells.

The behavior depends on the type parameter:

  • 'row': Toggles the first row between header and regular cells
  • 'column': Toggles the first column between header and regular cells
  • 'cell': Toggles the currently selected cells

When useSelectedRowColumn is true and type is 'row' or 'column', the command toggles the selected row/column instead of the first one.

Examples

ts
// Toggle first row as header
toggleHeader("row");
ts
// Toggle selected column as header
toggleHeader("column", { useSelectedRowColumn: true });