Handsontable example
HTML
<link rel="stylesheet" href="https://docs.handsontable.com/pro/bower_components/handsontable-pro/dist/handsontable.full.min.css">
<script src="https://docs.handsontable.com/pro/bower_components/handsontable-pro/dist/handsontable.full.min.js"></script>
Row density:
<button class="make20">20</button>
<button class="make30">30</button>
<button class="make40">40</button>
<div>
<div id="example1" class="hot handsontable htRowHeaders htColumnHeaders"></div>
</div>
CSS
body {
padding: 0;
margin: 0;
background: #fff;
font: 1.1em Helvetica;
}
.make20,
.make30,
.make40 {
border: 2px solid #4DD0E1;
background: #B2EBF2;
color: #555;
outline: none;
padding: 5px;
}
#example1 {
margin-top: 20px;
border-bottom: 2px solid #4DD0E1;
}
.handsontable {
font-size: 0.9em;
}
JavaScript
document.addEventListener("DOMContentLoaded", function() {
var example1 = document.getElementById('example1');
var hot = new Handsontable(example1, {
data: Handsontable.helper.createSpreadsheetData(100, 10),
colHeaders: true,
rowHeaders: true,
contextMenu: true,
autoRowSize: true,
className: 'htMiddle',
height: 400
});
var make20 = document.querySelector('.make20');
make20.addEventListener('click', function() {
hot.updateSettings({
rowHeights: 22
})
});
var make30 = document.querySelector('.make30');
make30.addEventListener('click', function() {
hot.updateSettings({
rowHeights: 30
})
});
var make40 = document.querySelector('.make40');
make40.addEventListener('click', function() {
hot.updateSettings({
rowHeights: 40
})
});
});