console-table-printer
console-table-printer copied to clipboard
Print table without Table Header
Originally started from this: https://github.com/ayonious/console-table-printer/issues/361
Im trying to find the best way to allow this. How would the input in this case look like? Should it be array or arrays of string?
I think passing Title value blank or null in column definition would be best. Or having a config array to Table constructor with headers: false
.
Another config I am thinking of is border: false
to print table without borders.
Using something like this should mean that the table has empty headers:
const table = new Table({
title: 'Bundle (BUNDLENAME)',
columns: [
{ name: 'Weapon', title: 'WEWWWW' },
{ name: 'Chroma', title: 'WEWWWW' },
{ name: 'Quality', title: '' },
{ name: 'Price' },
]
});
Now working making it work.
Another config I am thinking of is border: false to print table without borders. You should also be able to achieve this using the border symbols set to '' Like this
const table = new Table({
title: 'Bundle (BUNDLENAME)',
columns: [
{ name: 'Weapon', title: 'WEWWWW' },
{ name: 'Chroma', title: 'WEWWWW' },
{ name: 'Quality', title: '' },
{ name: 'Price' },
],
charLength: { '👍': 2, '✅': 2 },
style: {
headerTop: {
left: '',
mid: '',
right: '',
other: '',
},
headerBottom: {
left: '',
mid: '',
right: '',
other: '',
},
tableBottom: {
left: '',
mid: '',
right: '',
other: '',
},
vertical: '',
},
});
table.addRows([
{
Weapon: '👍',
Chroma: '✅',
Quality: 'Deluxe',
Price: '1 11 VP',
},
{
Weapon: 'thing',
Chroma: 'some',
Quality: 'Deluxe',
Price: '1 123 VP',
},
{
Weapon: 'asdfasdf',
Chroma: 'asfasdf',
Quality: 'Deluxe',
Price: '1 1000 PP',
},
]);
In latest release this case has been handled