JSFiddle - React, Tailwind, and code Playground
HTML
<div id="table-hot"></div>
<div id="modalPersonForm">
<table class="table" width="100%" cellspacing="0" cellpadding="5" border="0">
<tbody>
<tr class="odd">
<td class="label" width="1%" nowrap="">Name</td>
<td><input type="text" id="personName" name="personName" class="textbox-number-small" value=""></td>
</tr>
<tr>
<td class="label" width="1%" nowrap="">ID</td>
<td><input type="text" id="personID" name="personID" class="textbox-number-small" value=""></td>
</tr>
</tbody>
</table>
<div style="text-align: center; margin-top:15px;">
<input type="button" value="Delete" name="delete" id="deletePersonnel" hot-row="" />
</div>
</div>
CSS
</style><!-- Ugly Hack due to jsFiddle issue -->
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/handsontable@8.2.0/dist/handsontable.full.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/handsontable@8.2.0/dist/handsontable.full.min.css" />
JavaScript
var hotData = [
['<button type="button" class="editPerson" name="editLauncher">Edit</button>', 'Name: <span class="personName">Mary</span><br />ID: <span class="personID">1</span>', 25, 30, 45,'<center><button class="remove">x</button></center>'],
['<button type="button" class="editPerson" name="editLauncher">Edit</button>', 'Name: <span class="personName">Tom</span><br />ID: <span class="personID">2</span>', 15, 8, 22,'<center><button class="remove">x</button></center>'],
['<button type="button" class="editPerson" name="editLauncher">Edit</button>', 'Name: <span class="personName">Greg</span><br />ID: <span class="personID">3</span>', 5, 18, 15,'<center><button class="remove">x</button></center>'],
['<button type="button" class="editPerson" name="editLauncher">Edit</button>', 'Name: <span class="personName">Betty</span><br />ID: <span class="personID">4</span>', 10, 24, 38,'<center><button class="remove">x</button></center>'],
['','','=SUM(C1:C3)','=SUM(D1:D3)','=SUM(E1:E3)', '']
];
var hotOptions = {
licenseKey: 'non-commercial-and-evaluation',
data: hotData,
colHeaders: ['','Record','01', '02', '03', 'Delete'],
filters: true,
fixedRowsBottom: 1,
dropdownMenu: false,
formulas: true,
cells: function (row, col) {
var cellProperties = {};
var data = this.instance.getData();
var colLength = this.instance.countCols();
var rowLength = this.instance.countRows();
cellProperties.readOnly = col < 2 || row == (rowLength-1);
cellProperties.renderer = col < 2 || col == (colLength-1) ? safeHtmlRenderer : 'numeric';
cellProperties.type = col > 1 ? 'numeric' : 'text';
cellProperties.numericFormat = {
pattern: '0.00'
};
return cellProperties;
}
};
var hot = new Handsontable($('#table-hot').get(0), hotOptions);
function safeHtmlRenderer(instance, td, row, col, prop, value, cellProperties) {
td.innerHTML = Handsontable.helper.sanitize(value, {
ALLOWED_TAGS: ['button','br','span','center'],
...