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>
<button onclick="changeFontSize(10)">Font Size 10px</button>
<button onclick="changeFontSize(12)">Font Size 12px</button>
<button onclick="changeFontSize(15)">Font Size 15px</button>
<div id="pivot-container"></div>
JavaScript
let fontSize = 15;
const pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
height: 400,
//Initial size
aftergriddraw: () => {
changeFontSize(fontSize);
},
report: {
dataSource: {
filename: "data/data.csv"
},
slice: {
rows: [{
uniqueName: "Color"
},
{
uniqueName: "[Measures]"
}
],
columns: [{
uniqueName: "Country"
}],
measures: [{
uniqueName: "Price",
aggregation: "sum"
}]
}
}
});
function changeFontSize(size) {
fontSize = size;
document.querySelectorAll(".fm-filters .fm-header").forEach(el =>
el.style.fontSize = size + "px"
);
document.querySelectorAll("#fm-pivot-view .fm-cols-sheet .fm-cell").forEach(el =>
el.style.fontSize = size + "px"
);
}