Skip to main content

mergeCells()

Description

merges a range of cells into one or splits merged cells

Usage

mergeCells( 
cell: string,
remove?: boolean
);

Parameters

  • cell - (required) a range of cells (for instance, "A1:A5")
  • remove - (optional) defines the action to be done over the cells:
    • false - to merge cells (by default)
    • true - to split cells

Example

const spreadsheet = new dhx.Spreadsheet("spreadsheet", {});
spreadsheet.parse(data);

// merge cells A3, A4, and A5
spreadsheet.mergeCells("A2:A5");

// split cells A3, A4, and A5
spreadsheet.mergeCells("A2:A5", true);

Changelog: Added in v5.0

Related article: Work with cells