JSFiddle - React, Tailwind, and code Playground
by Flexmonster Pivot Table
HTML
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div id="pivot-container">The component will appear here</div>
CSS
#fm-pivot-view .fm-grid-row,
#fm-pivot-view .fm-grid-row-mobile {
min-height: 40px;
max-height: 120px;
height: 65px !important;
}
#fm-pivot-view .fm-grid-column,
#fm-pivot-view .fm-grid-column-mobile {
min-width: 50px;
max-width: 100px;
}
.fm-cell {
white-space: pre-wrap !important;
}
JavaScript
var pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
dataSource: {
data: getData()
},
options: {
grid: {
type: "flat"
}
},
tableSizes: {
"columns": [{
"tuple": [
"Berry"
],
"width": 90
}],
"rows": [{
"idx": 0,
"height": 40
}]
},
}
});
function getData() {
return [{
"Berry": {
type: "string"
},
"Price": {
type: "number"
}
},
{
"Berry": "Blueberry; Strawberry; Cranberry; Raspberry",
"Price": 174
}, {
"Berry": "Blueberry; Strawberry; Cranberry; Raspberry",
"Price": 30
}
];
}