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="exportCSV()">
Export to CSV
</button>
<div id="pivot-container"></div>

JavaScript

let pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  report: {
    options: {
      grid: {
        type: "flat"
      }
    },
    dataSource: {
      data: [{
        "Category": "Accessories",
        "Color": "green",
        "Piece ID": "00081108226052478670",
        "Price":25
      }],
      mapping: {
        "Piece ID": {
          type: "string"
        }
      }
    }
  }
});

function exportCSV(){
pivot.exportTo('CSV');
}