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-ui .fm-filter-header {
text-align: center !important;
}
#fm-pivot-view .fm-grid-layout .fm-filter-header.fm-filtered i.fm-filtered-icon {
right: 25px !important;
}
#fm-pivot-view .fm-grid-layout .fm-filter-header i.fm-filter-icon {
right: 12px !important;
}
JavaScript
new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 430,
toolbar: true,
report: {
dataSource: {
type: "csv",
filename: "data/sales.csv"
},
slice: {
rows: [{
uniqueName: "Customer"
}],
columns: [{
uniqueName: "[Measures]"
}],
measures: [{
uniqueName: "Revenue",
aggregation: "sum",
format: "2sfou03a"
}]
},
conditions: [{
formula: "#value < 2500",
isTotal: false,
measure: "Revenue",
format: {
backgroundColor: "#df3800",
color: "#FFFFFF"
}
},
{
formula: "#value > 20000",
isTotal: false,
measure: "Revenue",
format: {
backgroundColor: "#00A45A",
color: "#FFFFFF"
}
}
],
formats: [{
name: "2sfou03a",
thousandsSeparator: ",",
decimalSeparator: ".",
decimalPlaces: 2,
currencySymbol: "$",
positiveCurrencyFormat: "$1",
nullValue: "",
textAlign: "right",
isPercent: false
}],
tableSizes: {
columns: [{
idx: 0,
width: 270
}]
}
}
});