I want to merge the cells marked with jexcel. I don't know how to do that. More specifically, I want to merge cells into a dynamic state and write them into merged cells in MySQL. How to do it
<div id="example"></div>
<script>
var data = [
['', 'Ford', 'Tesla', 'Toyota', 'Honda'],
['2017', 10, 11, 12, 13],
['2018', 20, 11, 14, 13],
['2019', 30, 15, 12, 13]
];
var container = document.getElementById('example');
var hot = new Handsontable(container, {
data: data,
rowHeaders: true,
colHeaders: true,
filters: true,
dropdownMenu: true,
contextMenu: true
});
</script>
Your Question is not clear but I'll try to answer it to the best of my ability.
if I ignore the example you provided and focus on jExcel, we can merge cells using
setMerge
and for that we need to know:we can extract this info from:
in theory this alone should work, but jExcel deselects cells when it loses focus (ie when user clicks a button) that's why I used a workarround to store the selection of cells in an object, and later used that object to merge cells.
HTML:
Javascript:
Requirements: jQuery, jExcel and jSuites v3
Here's a Working Example at CodePen