- Console log a grid
- Support tree style rows
- Custom cell formatter
- Column align/sorting
- Multiple lines header
- Support colorful cells
npm i console-grid
{placeholder_list}
Data Format Definition: CGDF
{
options: Object, //define grid level options
columns: Array, //define column list and header
rows: Array //define row list
}
{
silent: false,
headerVisible: false,
padding: 1,
defaultMinWidth: 1,
defaultMaxWidth: 50,
sortField: '',
sortAsc: false,
sortIcon: '*',
treeId: 'name',
treeIcon: '├ ',
treeLink: '│ ',
treeLast: '└ ',
treeIndent: ' ',
nullPlaceholder: '-',
//border definition:
//H: horizontal, V: vertical
//T: top, B: bottom, L: left, R: right, C: center
borderH: '─',
borderV: '│',
borderTL: '┌',
borderTC: '┬',
borderTR: '┐',
borderCL: '├',
borderCC: '┼',
borderCR: '┤',
borderBL: '└',
borderBC: '┴',
borderBR: '┘',
getCharLength: defaultGetCharLength
}
{
id: String,
name: String,
type: String, //string, number
align : String, //left(default), center, right
minWidth: Number,
maxWidth: Number,
formatter: Function //custom cell formatter
}
{
//column id key: cell value
innerBorder: Boolean,
subs: Array //sub rows
}
markdown-grid - Markdown Grid Generator