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
/* CSS for changing headers width */
#fm-pivot-view div.fm-ui-element.fm-filters.fm-cols-filter div {
width: 70px;
min-width: 70px !important;
}
/* CSS for changing column width */
#fm-pivot-view .fm-grid-column,
#fm-pivot-view .fm-grid-column-mobile {
width: 70px !important;
min-width: 70px;
}
JavaScript
const pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
height: 400,
report: {
dataSource: {
filename: "data/data.csv",
},
slice: {
rows: [{
uniqueName: "Country"
},
{
uniqueName: "[Measures]"
}
],
columns: [{
uniqueName: "Color"
}, {
uniqueName: "Category"
}],
measures: [{
uniqueName: "Price",
aggregation: "sum"
}]
}
}
});