JSFiddle - React, Tailwind, and code Playground
Custom CSS
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-row,
#fm-pivot-view .fm-grid-row-mobile {
height: 40px !important;
min-height: 40px;
}
#fm-pivot-view .fm-grid-column,
#fm-pivot-view .fm-grid-column-mobile {
width: 150px !important;
min-width: 150px;
}
#fm-pivot-view .fm-grid-header,
#fm-pivot-view .fm-grid-header-mobile {
height: 40px !important;
width: 40px !important;
}
#fm-pivot-view .fm-grid-layout div.fm-cell {
padding-top: 3px !important;
padding-bottom: 0 !important;
font-size: 22px !important;
}
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: "Color",
filter: {
members: ["color.[blue]", "color.[green]", "color.[purple]"],
},
},
{
uniqueName: "[Measures]",
},
],
columns: [
{
uniqueName: "Business Type",
},
],
measures: [
{
uniqueName: "Price",
aggregation: "sum",
},
],
},
},
})