JSFiddle - React, Tailwind, and code Playground
by mpusarla
HTML
<div id="basic_example"></div>
CSS
</style>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<link href="http://handsontable.com//styles/main.css" rel="stylesheet">
<link href="http://handsontable.com//bower_components/handsontable/dist/handsontable.full.min.css" rel="stylesheet">
<script src="http://corecms:8081/include/js/handsontable.full.js" type="text/javascript"></script>
<style type="text/css">
body {background: white; margin: 20px;}
h2 {margin: 20px 0;}
div#basic_example {
border: 5px solid #ccc;
}
JavaScript
$(document).ready(function () {
var container = document.getElementById('basic_example');
var data = function () {
return Handsontable.helper.createSpreadsheetData(5, 10);
};
var hot = new Handsontable(container, {
data: data(),
colHeaders: true,
stretchH: 'all',
// afterCreateRow: handleAfterCreateRow,
minSpareRows: 1
});
if (hot.countVisibleRows() < hot.countRows()) {
hot.updateSettings({height: 300});
hot.view = new Handsontable.TableView(hot);
}
});
function handleAfterCreateRow() {
var instance = this;
if (instance.rootElement.clientHeight > 300) {
instance.updateSettings({height: 300});
instance.view = new Handsontable.TableView(instance);
}
}