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>

JavaScript

let pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  customizeCell: customizeCellFunction,
  toolbar: true,
  report: {
    dataSource: {
      type: "json",
      data: getData()
    },
    slice: {
      rows: [{
        uniqueName: "Status"
      }, {
        uniqueName: "Country"
      }],
      columns: [{
        uniqueName: "[Measures]"
      }],
      measures: [{
        uniqueName: "Price",
        format: "decimal5"
      }],
      expands: {
        expandAll: true
      }

    },

  }
});

function customizeCellFunction(cell, data) {
  if (data.type == 'value' && !data.isDrillThrough && data.value) {
    cell.text = data.value.toFixed(5);
  }
}

function getData() {
  return [{
      "Status": "On hold",
      "Country": "Austria",
      "Price": 0
    }, {
      "Status": "On hold",
      "Country": "Australia",
      "Price": 0.00105321
    }, {
      "Status": "On hold",
      "Country": "Canada",
      "Price": 0.01697321
    }, {
      "Status": "On hold",
      "Country": "Denmark",
      "Price": 0.01497321
    }, {
      "Status": "On hold",
      "Country": "Israel",
      "Price": -0.00365321
    }, {
      "Status": "On hold",
      "Country": "Japan",
      "Price": -0.00676321
    }, {
      "Status": "On hold",
      "Country": "Norway",
      "Price": 0.00234321
    }, {
      "Status": "On hold",
      "Country": "Poland",
      "Price": -0.00842321
    },
    {
      "Status": "On hold",
      "Country": "Sweden",
      "Price": 0.00309312
    }, {
      "Status": "On hold",
      "Country": "Switzerland",
      "Price": -0.00892321
    }, {
      "Status": "On hold",
      "Country": "USA",
      "Price": 0
    }, {
      "Status": "On hold",
      "Country": "Ukraine",
      "Price": -0.00015321
    },
  ]
}