tabela
v0.1.2
Published
Create simple tables.
Downloads
2
Readme
tabela
Create simple tables.
Installation
Install it with the following command:
$ npm install tabela
Usage
var tabela = require("tabela");
tabela(data[, options])
Where data
must be an array of arrays with the table data.
And options
must be an object.
The options can be:
alignment
- text alignment (can becenter
orleft
)color
- header color (see here the colors)
Example
See the below example:
"use strict";
var tabela = require("tabela");
var table = tabela([
["Name", "Ana", "Bruna", "Camila"],
["Age", 21, 20, 30],
["Weight", "70 kg", "85 kg", "78 kg"],
["Height", "1,86 m", "1,71 m", "1,66 m"]
]);
console.log(table);
The above example will return:
+--------------------------------+
| Name | Age | Weight | Height |
|--------|-----|--------|--------|
| Ana | 21 | 70 kg | 1,86 m |
| Bruna | 20 | 85 kg | 1,71 m |
| Camila | 30 | 78 kg | 1,66 m |
+--------------------------------+
License
MIT