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.alter {
background-color: #e1e1e1 !important;
}
#fm-pivot-view .fm-grid-view div.fm-header.fm-header-c.fm-total-c, #fm-pivot-view .fm-grid-view div.fm-header.fm-header-c.fm-level-1 {
text-align: right !important;
}
JavaScript
let pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
dataSource: {
filename: "data/retail-data.json"
},
slice: {
rows: [{
uniqueName: "Country"
}],
columns: [{
uniqueName: "Date.Year"
}, {
uniqueName: "Date.Month"
}],
measures: [{
uniqueName: "Price"
}],
},
tableSizes: {
columns: [{
measure: {
"uniqueName": "Price",
"aggregation": "sum"
},
width: 168
}]
}
}
});