JSFiddle - React, Tailwind, and code Playground

by Flexmonster Pivot Table

HTML

<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

<div id="pivot-container"></div>

JavaScript

let pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  report: getReport()
});

/*Add style*/
var style = (function() {
  var style = document.createElement("style");
  document.head.appendChild(style);
  return style;
})();

/*Calculate lowest fm-level*/
let lvl = getReport().slice.rows.length - 1;

/*Insert rule which highlights total cells with lowest level*/
style.sheet.insertRule("#fm-pivot-view .fm-grid-view div.fm-cell.fm-grand-total.fm-grand-total-c.fm-level-" + lvl + "{background-color: #DF3800; color: white;}");


function getReport() {
  return {
    dataSource: {
      filename: "data/data.json"
    },
    slice: {
      rows: [{
          uniqueName: "Country"
        },
        {
          uniqueName: "Business Type"
        },
        {
          uniqueName: "Destination"
        }
      ],
      columns: [{
        uniqueName: "Color",
        filter: {
          members: ["blue", "green"]
        }
      }],
      measures: [{
        uniqueName: "Price"
      }]
    }
  };
}