Plugin, which allows merging cells in the table (using the initial configuration, API or context menu).
Example
const hot = new Handsontable(document.getElementById('example'), {
data: getData(),
mergeCells: [
{row: 0, col: 3, rowspan: 3, colspan: 3},
{row: 2, col: 6, rowspan: 2, colspan: 2},
{row: 4, col: 8, rowspan: 3, colspan: 3}
],
Methods
-
clearCollections()
-
Clears the merged cells from the merged cell container.
-
disablePlugin()
-
Disables the plugin functionality for this Handsontable instance.
-
enablePlugin()
-
Enables the plugin functionality for this Handsontable instance.
-
isEnabled(){Boolean}
-
Checks if the plugin is enabled in the handsontable settings. This method is executed in
Hooks#beforeInit
hook and if it returnstruethan theMergeCells#enablePluginmethod is called.Returns: {Boolean}
-
merge(startRow, startColumn, endRow, endColumn)
-
Merges the specified range.
Parameters:
Name Type Description startRowNumber Start row of the merged cell.
startColumnNumber Start column of the merged cell.
endRowNumber End row of the merged cell.
endColumnNumber End column of the merged cell.
Fires:
-
mergeSelection(cellRange)
-
Merges the selection provided as a cell range.
Parameters:
Name Type Description cellRangeCellRange optional Selection cell range.
-
unmerge(startRow, startColumn, endRow, endColumn)
-
Unmerges the merged cell in the provided range.
Parameters:
Name Type Description startRowNumber Start row of the merged cell.
startColumnNumber Start column of the merged cell.
endRowNumber End row of the merged cell.
endColumnNumber End column of the merged cell.
Fires:
-
unmergeSelection(cellRange)
-
Unmerges the selection provided as a cell range.
Parameters:
Name Type Description cellRangeCellRange optional Selection cell range.
-
updatePlugin()
-
Updates the plugin state. This method is executed when
Core#updateSettingsis invoked.