<div id="table1"></div>
<br>
<div id="table2"></div>
<br>
<div id="table3"></div>
<br>
<div id="table4"></div>
var pivotTable1 = new hx.PivotTable('#table1')
var pivotTable2 = new hx.PivotTable('#table2')
var pivotTable3 = new hx.PivotTable('#table3')
var pivotTable4 = new hx.PivotTable('#table4', { fullWidth: true })
var data1 = {
topHead: [
'Head 1',
'Head 2',
'Head 3'
],
leftHead: [
'Head 1',
'Head 2',
'Head 3'
],
body: [
[
'Cell 1',
'Cell 2',
'Cell 3'
],
[
'Cell 1',
'Cell 2',
'Cell 3'
],
[
'Cell 1',
'Cell 2',
'Cell 3'
]
]
}
var data2 = {
leftHead: [
'Head 1',
'Head 2',
'Head 3'
],
body: [
[
'Cell 1',
'Cell 2',
'Cell 3'
],
[
'Cell 1',
'Cell 2',
'Cell 3'
],
[
'Cell 1',
'Cell 2',
'Cell 3'
]
]
}
var data3 = {
topHead: [
'Head 1',
'Head 2',
'Head 3'
],
body: [
[
'Cell 1',
'Cell 2',
'Cell 3'
],
[
'Cell 1',
'Cell 2',
'Cell 3'
],
[
'Cell 1',
'Cell 2',
'Cell 3'
]
]
}
pivotTable1.data(data1)
pivotTable2.data(data2)
pivotTable3.data(data3)
pivotTable4.data(data1)
function (data, element, isHead, column) {
hx.select(element).text(data)
}
topHead
, leftHead
and body
. {
topHead: [
'Header',
...// Headers for the top of the table
],
leftHead: [
'Header',
...// Headers for the first column
],
body: [
[
'Row 1',
..// Row Data
],
...// Body Data
]
}
hx.StickyTableHeaders
to the table th
node of the top left cell. Values entered in this cell will affect the sizes of the left/top headings. topHead
, leftHead
and body
. {
topHead: [
'Header',
...// Headers for the top of the table
],
leftHead: [
'Header',
...// Headers for the first column
],
body: [
[
'Row 1',
..// Row Data
],
...// Body Data
]
}