Is there a way to get wrapText working for columns in a table? I'm trying the following and it's not registering in excel.
const columnsStyle = { font: { name: 'Arial Black', size: 12 } };
const columns = [
{ name: 'PO#', style: columnsStyle, alignment: { wrapText:true } }
];
ws.addTable({
name: 'name',
ref: `A${lastRowNum}`,
columns: columns,
rows: rows,
});
I've also attempted to include the word "alignment" in the "style" object, however, doing so causes an error when opened in Excel. (Excel claims there was a creation issue because the table looks different and lacks wrap text.)
const columnsStyle = { font: { name: 'Arial Black', size: 12 }, alignment: { wrapText:true } }; const columns = [ { name: 'PO#', style: columnsStyle, } ];
I also want to get all cells in these columns of the table wrapped too. Does anybody have any idea on how to do this? I looked through the documentation several times and couldn't find anything concrete.
Note: I know I can do ws.getCell(ref).alignment = {wrapText:true} and so I tried looking at the table object to see if I could get a reference of all the cells in it, loop through them, and set the alignment. But I was not able to get cells in the table.