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>
<button onclick="printFM()">Print to PDF</button>
<div id="pivot-container"></div>
CSS
#fm-pivot-view .fm-cell{
border-right: none !important;
border-left: none !important;
border-bottom: dashed 2px #e9e9e9 !important;
}
#fm-pivot-view .fm-header-c{
border-bottom: solid 3px #e9e9e9 !important;
}
#fm-pivot-view .fm-header[data-c="1"]{
border-right: solid 1px #e9e9e9 !important;
}
#fm-pivot-view .fm-header[data-r="0"]{
border-bottom: solid 3px #e9e9e9 !important;
}
#fm-pivot-view .fm-filter-header{
border-bottom: solid 3px #e9e9e9 !important;
background-color: #f7f7f7 !important;
}
#fm-pivot-view .fm-header-r{
border-bottom: solid 1px #e9e9e9 !important;
}
JavaScript
let pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
report: {
dataSource: {
filename: "data/data.csv"
},
options: {
configuratorActive: false,
showTotals:false,
showHeaders:false,
grid: {
type: "classic"
}
},
slice: {
expands:{expandAll:true},
rows: [{
uniqueName: "Business Type"
}, {
uniqueName: "Category"
}],
columns: [{
uniqueName: "[Measures]"
}],
measures: [{
uniqueName: "Price"
},
{
uniqueName: "Discount"
}]
}
}
});
function printFM(){
flexmonster.print();
}