To enable the merge cells feature, set the mergeCells
option to be true
or an
array.
To initialize Handsontable with predefined merged cells, provide merged cells details in form of an
array:
mergeCells: [{row: 1, col: 1, rowspan: 2, colspan: 2}]
var container = document.getElementById('example1'),
hot;
hot = new Handsontable(container, {
data: Handsontable.helper.createSpreadsheetData(1000, 16),
colWidths: [55, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47], // can also be a number or a function
rowHeaders: true,
colHeaders: true,
contextMenu: true,
mergeCells: [
{row: 1, col: 1, rowspan: 3, colspan: 3},
{row: 3, col: 4, rowspan: 2, colspan: 2}
]
});