Closed hustcer closed 9 years ago
Delay
You need to pass a string length function that would take wide characters into account.
var table = require('text-table'),
wcwidth = require('wcwidth');
var t = table([
[ '中国好声音', '1024000' ],
[ '舞蹈', '33450' ],
[ 'foo', '1006' ],
[ '中文对齐有点儿问题哦', '45.08' ]
], {
align: [ 'l', 'r' ],
stringLength: wcwidth
});
console.log(t);
This one will be better: https://github.com/timoxley/columnify
Use
text-table
to align console output