# 首先安装对应的模块
npm install word-table
var word-table = require('word-table');
var header = ['id', 'name', 'birthday'];
var body = [
['#1', '王小为', '1992-08-01', '备注:hustcc'],
['#2', '小泥巴', '1992-09-20'],
['#3', '佚名', '保密']
];
// basic usage
var wt = new WordTable(header, body);
console.log(wt.string());
// will print in console.
+----+----------+----------------+------------------+
| id | name | birthday | |
+----+----------+----------------+------------------+
| #1 | 王小为 | 1992-08-01 | 备注:hustcc |
+----+----------+----------------+------------------+
| #2 | 小泥巴 | 1992-09-20 | |
+----+----------+----------------+------------------+
| #3 | 刘德华 | null | |
+----+----------+----------------+------------------+