JSFiddle - React, Tailwind, and code Playground
HTML
<div id="hot" class="handsontable"></div>
CSS
</style>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/handsontable@latest/dist/handsontable.full.min.css">
<link rel="stylesheet" type="text/css" href="https://handsontable.com/static/css/main.css">
<script src="https://cdn.jsdelivr.net/npm/handsontable@latest/dist/handsontable.full.min.js"></s
JavaScript
var dataObject = [{
id: 1,
category: "Grocery",
sub_category: "Bean",
brand: "Tata Sampann",
active: true
}, {
id: 2,
category: "Grocery",
sub_category: "Cereals",
brand: "Tata Sampann",
active: false
}, {
id: 3,
category: "Grocery",
sub_category: "Bean",
brand: "Satyam",
active: false
}, {
id: 4,
category: "Grocery",
sub_category: "Cereals",
brand: "Satyam",
active: false
}]
var hotElement = document.querySelector('#hot');
var hotElementContainer = hotElement.parentNode;
var hotSettings = {
data: dataObject,
stretchH: 'all',
width: 1000,
autoWrapRow: true,
height: 487,
maxRows: 22,
manualRowResize: true,
manualColumnResize: true,
// rowHeaders: true,
columns: [
{
data: 'id',
type: 'checkbox'
},
{
data: 'id'
},
{
data: 'category'
},
{
data: 'sub_category'
},
{
data: 'brand'
}
],
colHeaders: [
'Add',
'Id',
'Category',
'Sub-Category',
'Brand',
],
manualRowMove: true,
manualColumnMove: true,
contextMenu: true,
filters: true,
dropdownMenu: true,
language: 'en-US'
};
var hot = new Handsontable(hotElement, hotSettings);