-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'header' or 'showHeader' option #13
Comments
Hi, whether you include a header row, and how it looks is up to you.. if you want the first row to include header titles, then pass it in with the table data array.. As an example, this project uses table-layout adding its own header row.. |
If we include a |
I really like the simple interface with no complicated setup steps. If a user wants more, he can add his customized header to his data. const data = [{"name":"udp","ms":395,"packets":20000,"rawbytes":1040000,"bytes":600000,"ratio":0.58},{"name":"http","ms":1554,"packets":20052,"rawbytes":3413448,"bytes":2090000,"ratio":0.61},{"name":"https","ms":1859,"packets":20215,"rawbytes":3866296,"bytes":2532090,"ratio":0.65},{"name":"mqtt2","ms":1312,"packets":40071,"rawbytes":3004749,"bytes":360059,"ratio":0.12},{"name":"mqtt1","ms":712,"packets":20216,"rawbytes":1614307,"bytes":280035,"ratio":0.17},{"name":"mqtt0","ms":139,"packets":53,"rawbytes":223549,"bytes":220035,"ratio":0.98}]
console.log(new TableLayout(data,{headers:true}).toString())
name ms packets rawbytes bytes ratio
udp 395 20000 1040000 600000 0.58
http 1554 20052 3413448 2090000 0.61
https 1859 20215 3866296 2532090 0.65
mqtt2 1312 40071 3004749 360059 0.12
mqtt1 712 20216 1614307 280035 0.17
mqtt0 139 53 223549 220035 0.98 |
Hi.. If you want a header like the one you described above, simply add the header row yourself to the top of the array you pass into I don't think I will add the |
i like this simple table module. i am just missing an option to print the property names as column headers.
The text was updated successfully, but these errors were encountered: