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 tried putting 'alignment' in the 'style' object but it results in an error when opening in excel. (Table looks different and has no wrap text and excel says there's an error in trying to create it)
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.