Handsontable Basic Example (100x10)
HTML
<link rel="stylesheet" href="https://handsontable.com/bower_components/handsontable/dist/handsontable.full.css">
<script src="https://cdn.jsdelivr.net/npm/handsontable-pro@latest/dist/handsontable.full.js"></script>
<h2>Handsontable - Show bug when increasing table size.</h2>
<div id="example"></div>
<button onclick="increaseColumns()">Increase Number of Columns by 2</button>
CSS
body {
margin: 20px 30px;
font-size: 13px;
font-family: 'Open Sans', Helvetica, Arial;
}
a {
color: #34A9DC;
text-decoration: none;
}
p {
margin: 5px 0 20px;
}
h2 {
margin: 20px 0 0;
font-size: 18px;
font-weight: normal;
}
JavaScript
var data = function() {
return Handsontable.helper.createSpreadsheetData(5, 5);
};
var container = document.getElementById('example');
var hot = new Handsontable(container, {
data: data(),
colHeaders: true,
columnSorting: true,
});
var numColumns = 5;
var increaseColumns = function() {
hot.alter('insert_col', hot.countCols(), 2)
}