Skip to content

Type Editor


Type Editor / @type-editor/tables / commands/merge-cells / mergeCells

Function: mergeCells()

ts
function mergeCells(state, dispatch?): boolean;

Defined in: tables/src/commands/merge-cells.ts:29

Merges the selected cells into a single cell.

This command is only available when:

  • Multiple cells are selected via CellSelection
  • The selected cells' outline forms a proper rectangle
  • No cells partially overlap the selection boundary

The merged cell will contain the combined content of all merged cells.

Parameters

ParameterTypeDescription
statePmEditorStateThe current editor state
dispatch?DispatchFunctionOptional dispatch function to execute the command

Returns

boolean

True if the command is applicable, false otherwise