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>

<h3>
  Try exporting to HTML using the "Export" tab
</h3>

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

JavaScript

var pivot = new Flexmonster({
  container: "#pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  beforetoolbarcreated: customizeToolbar,
  report: {
    "dataSource": {
      "type": "csv",
      "filename": "https://cdn.flexmonster.com/data/data.csv"
    },
    "slice": {
      "rows": [{
          "uniqueName": "Destination"
        },
        {
          "uniqueName": "Color"
        },
        {
          "uniqueName": "[Measures]"
        }
      ],
      "columns": [{
          "uniqueName": "Category"
        },
        {
          "uniqueName": "Country"
        }
      ],
      "measures": [{
          "uniqueName": "Price",
          "aggregation": "sum"
        },
        {
          "uniqueName": "Discount",
          "aggregation": "sum"
        },
        {
          "uniqueName": "Quantity",
          "aggregation": "sum"
        }
      ],
      "expands": {
        "rows": [{
          "tuple": [
            "destination.[france]"
          ]
        }],
        "columns": [{
          "tuple": [
            "category.[accessories]"
          ]
        }]
      },
      "flatSort": [{
        "uniqueName": "Destination",
        "sort": "asc"
      }]
    },
    "options": {
      "grid": {
         "title": "My Daily Report"
      },
      "showEmptyData": false
    },
    "formats": [{
      "name": "",
      "thousandsSeparator": " ",
      "decimalSeparator": ".",
      "decimalPlaces": 2,
      "maxSymbols": 20,
      "currencySymbol": "",
      "positiveCurrencyFormat": "$1",
      "nullValue": " ",
      "infinityValue": "Infinity",
      "divideByZeroValue": "Infinity"
    }]
  }
});

function customizeToolbar(toolbar) {
  var tabs = toolbar.getTabs();
  toolbar.getTabs = function() {
    let exportTab = tabs.find(tab => tab.id == "fm-tab-export");
    if (!exportTab) return tabs;
    let exportToHTMLTab = exportTab.menu.find(tab => tab.id == "fm-tab-export-html");
    exportToHTMLTab.handler = () => {
...