Closed thejh closed 12 years ago
It will be a kind of mess whereas doing this manualy for the concrete use case is as simple as:
var table = {
"byte": [],
"count": []
}
data.forEach(function (line) {
table["byte"].push(line["byte"])
table["count"].push(line["count"])
})
var t = new EasyTable
for (var key in table) {
t.cell('Prop / SampleNo', key)
table[key].forEach(function (sample, index) {
t.cell(index + 1, sample)
})
t.newLine()
}
console.log(t.toString())
Just few extra lines of code
How about adding an option for switching between the normal format and one where rows and columns are reversed?
E.g. turn
into