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>

<button onclick="setTableSizes()">Set table sizes</button>

<div id="pivot-container">The component will appear here</div>

JavaScript

let pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  height: 300,
  report: {
    dataSource: {
      filename: "data/data.csv"
    },
    slice: {
      rows: [{
        uniqueName: "Category"
      }, {
        uniqueName: "Color"
      }],
      columns: [{
          uniqueName: "Country",
          filter: {
            exclude: [
              "country.[canada]",
              "country.[united kingdom]"
            ]
          }
        },
        {
          uniqueName: "[Measures]"
        }
      ],
      measures: [{
        uniqueName: "Price",
        aggregation: "sum"
      }],
      expands: {
        rows: [{
          tuple: [
            "category.[cars]"
          ]
        }]
      }
    }
  }
});

function setTableSizes() {
  flexmonster.setTableSizes({
    rows: [{
      tuple: ["category.[cars]", "color.[blue]"],
      height: 80
    }]
  });
}