JSFiddle - React, Tailwind, and code Playground
by Flexmonster Pivot Table
HTML
<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div id="pivot-container"></div>
CSS
#fm-pivot-view .fm-grid-view div.fm-cell.alter1 {
background-color: #f7f7f7 !important;
}
#fm-pivot-view .fm-grid-view div.fm-cell.alter2 {
background-color: #fcfcfc !important;
}
JavaScript
let pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
"dataSource": {
"filename": "data/data.json"
},
options: {
grid: {
type: "flat"
}
}
}
});
flexmonster.customizeCell((cell, data) => {
if (data.rowIndex % 2 == 1) {
cell.addClass("alter1");
} else {
cell.addClass("alter2");
}
});