JSFiddle - React, Tailwind, and code Playground
by provegard
HTML
<script src="https://raw.github.com/warpech/jquery-handsontable/master/jquery.handsontable.js"></script>
<div id="adiv">
</div>
CSS
/**
* It may be useful to copy the below styles and use on your page
*/
.dataTable {
position: relative;
font-family: Arial, Helvetica, sans-serif;
line-height: 1.3em;
font-size: 13px;
}
.dataTable table {
border-collapse: separate;
position: relative;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
border-spacing: 0;
width: 100%; /* <---- fill horizontally */
}
.dataTable th,
.dataTable td {
border-right: 1px solid #CCC;
border-bottom: 1px solid #CCC;
min-width: 50px;
height: 22px;
line-height: 16px;
padding: 0 4px 0 4px; /* top, bottom padding different than 0 is handled poorly by FF with HTML5 doctype */
}
.dataTable div.minWidthFix {
width: 50px;
}
.dataTable tr:first-child th.htNoFrame,
.dataTable th:first-child.htNoFrame,
.dataTable th.htNoFrame {
border-left-width: 0;
background-color: white;
border-color: #FFF;
}
.dataTable th:first-child,
.dataTable td:first-child,
.dataTable .htNoFrame + th,
.dataTable .htNoFrame + td {
border-left: 1px solid #CCC;
}
.dataTable tr:first-child th,
.dataTable tr:first-child td {
border-top: 1px solid #CCC;
}
.dataTable thead tr:last-child th {
border-bottom-width: 0;
}
.dataTable thead tr.lastChild th {
border-bottom-width: 0;
}
.dataTable th {
background-color: #EEE;
color: #222;
text-align: center;
font-weight: normal;
white-space: nowrap;
font-weight: bold;
}
.dataTable th .small {
font-size: 12px;
}
.dataTable thead th {
padding: 2px 4px;
}
.dataTable th.active {
background-color: #CCC;
}
/* border background */
.dataTable .htBorderBg {
position: absolute;
font-size: 0;
}
.dataTable .htBorderBg.selection {
background-color: #EEF4FF;
}
/* border line */
.dataTable .htBorder {
position: absolute;
width: 2px;
height: 2px;
background: #000;
font-size: 0;
}
.dataTable .htBorder.current {
background: #5292F7;
width: 2px;
height:...
JavaScript
$("#adiv").handsontable({
rows: 3,
cols: 5,
colHeaders: ["a", "b", "c", "d", "e"],
rowHeaders: true
});