代码拉取完成,页面将自动刷新
word-table is a simple javascript (browserjs / nodejs) library for drawing ascii tables in the
terminal
/console
. Based on word-width.
npm install word-table
script
tag in HTML.<script type="text/javascript" src="dist/word-table.min.js"></script>
require
.var WordTable = require('word-table');
//or
import WordTable from 'word-table';
See a demo firstly:
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());
The API is so simple that documents are not needed.
wt.setHeader(['id', 'name', 'birthday']);
wt.appendBody(['#3', '佚名', '保密']);
wt.setBody([['#4', '在线工具', '保密', 'atool.org']]);
wt.array();
wt.string();
wt.reset();
Detail usage and demo code, can see here, and run npm test
can see the output.
The api are all chainable method, e.g.
var wt = new WordTable();
wt.reset()
.setHeader(['id', 'name', 'birthday'])
.appendBody(['#3', '佚名', '保密']);
var str = wt.string();
npm install
npm run build
npm test
Or you can open the website, then test it in Console [F12]
.
MIT@hustcc.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。