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-view div.fm-cell.highlight{
  background-color: #FF5733 !important;
}

JavaScript

let pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  customizeCell: customizeCellFunction,
  report: {
    "dataSource": {
      "filename": "data/data.json"
    },
    "options": {
      "grid": {
        "type": "flat"
      }
    },
    "slice": {
      "rows": [{
        "uniqueName": "Country"
      }],
      "columns": [{
        "uniqueName": "Color"
      }],
      "measures": [{
        "uniqueName": "Price"
      }, {
        "uniqueName": "Quantity"
      }]
    }
  }
});

function customizeCellFunction(cell, data) {
  if (data.type == "value" && cell.text == "Canada") {
    cell.addClass("highlight");
  }
}