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-layout .fm-total {
background-color: #8c8c8c !important;
color: black !important;
font-size: 14px !important;
}
#fm-pivot-view .fm-grid-layout .fm-grand-total {
background-color: #f4b19f !important;
}
#fm-rows-sheet .fm-header-r {
background-color: #ff9100 !important;
color: white !important;
}
#fm-cols-sheet .fm-header-c {
background-color: #ff6464 !important;
color: white !important;
}
JavaScript
var pivot = new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 465,
toolbar: true,
report: {
dataSource: {
filename: "data/data.csv"
},
"slice": {
"rows": [{
"uniqueName": "Country",
"filter": {
"members": [
"country.[canada]",
"country.[france]"
]
}
}, {
"uniqueName": "Business Type"
}],
"columns": [{
"uniqueName": "Category",
"filter": {
"members": [
"category.[bikes]",
"category.[cars]"
]
}
}, {
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "Price",
"aggregation": "sum",
"format": "currency"
}, {
"uniqueName": "Discount",
"aggregation": "sum",
"active": false,
"format": "currency"
}],
"expands": {
"expandAll": true
}
}
}
});