as-table
as-table copied to clipboard
Wrap Text
First of all thanks for the module.
Is it possible to wrap the text of field data? Setting the widths of columns results in the data being truncated. I used the print option to format my data so that a newline was inserted at the 20th character but \n
is rendered as is (i.e. not as a line break):
console.log(asTable.configure({
maxTotalWidth: 100,
delimiter: ' | ',
print: x => x.slice(0, 20) + '\n' + x.slice(21)
})(data));
I think this is due to https://github.com/xpl/as-table/blob/8df56d83c335ec5689d9e5e5ec233968678ab858/as-table.js#L15
Is there any way I can get around this?