JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://nicolas.kruchten.com/pivottable/examples/ext/jquery-1.8.3.min.js"></script>
<script src="http://nicolas.kruchten.com/pivottable/examples/ext/jquery-ui-1.9.2.custom.min.js"></script>
<script src="http://nicolas.kruchten.com/pivottable/dist/pivot.js"></script>
<link rel="stylesheet" href="http://nicolas.kruchten.com/pivottable/dist/pivot.css">
<p><a href="http://nicolas.kruchten.com/pivottable/examples/index.html">« back to examples</a></p>
<div id="output" style="margin: 10px;"></div>
JavaScript
/*Copied pivotTableRenderer from pivot.js, edited line 116*/
var $,__hasProp = {}.hasOwnProperty;
$ = jQuery;
var pivotTableRenderer2 = function(pivotData, opts) {
var aggregator, c, colAttrs, colKey, colKeys, defaults, i, j, r, result, rowAttrs, rowKey, rowKeys, spanSize, td, th, totalAggregator, tr, txt, val, x;
defaults = {
localeStrings: {
totals: "Totals"
}
};
opts = $.extend(defaults, opts);
colAttrs = pivotData.colAttrs;
rowAttrs = pivotData.rowAttrs;
rowKeys = pivotData.getRowKeys();
colKeys = pivotData.getColKeys();
result = document.createElement("table");
result.className = "pvtTable";
spanSize = function(arr, i, j) {
var len, noDraw, stop, x, _i, _j;
if (i !== 0) {
noDraw = true;
for (x = _i = 0; 0 <= j ? _i <= j : _i >= j; x = 0 <= j ? ++_i : --_i) {
if (arr[i - 1][x] !== arr[i][x]) {
noDraw = false;
}
}
if (noDraw) {
return -1;
}
}
len = 0;
while (i + len < arr.length) {
stop = false;
for (x = _j = 0; 0 <= j ? _j <= j : _j >= j; x = 0 <= j ? ++_j : --_j) {
if (arr[i][x] !== arr[i + len][x]) {
stop = true;
}
}
if (stop) {
break;
}
len++;
}
return len;
};
for (j in colAttrs) {
if (!__hasProp.call(colAttrs, j)) continue;
c = colAttrs[j];
tr = document.createElement("tr");
if (parseInt(j) === 0 && rowAttrs.length !== 0) {
th = document.createElement("th");
th.setAttribute("colspan", rowAttrs.length);
th.setAttribute("rowspan", colAttrs.length);
tr.appendChild(th);
}
th = document.createElement("th");
th.className = "pvtAxisLabel";
th.textContent = c;
tr.appendChild(th);
for (i in colKeys) {
if (!__hasProp.call(colKeys, i)) continue;
colKey = colKeys[i];
x...