I am trying to add column width of 12.5% for all and i have 8 columns
If there's no text in any cell then they follow the spacing specified by columnWidths, But when there's text, they are not following the given width size
Here is my code -
const doc = new Document();
const abc = new Table({
rows: 8,
columns: 8,
width: 100,
columnWidths: new Array(8).fill(12.5),
widthUnitType: WidthType.PERCENTAGE,
});
abc.getCell(0, 0).addParagraph(new Paragraph("Hellohello hellohellohello"));
doc.addTable(abc);
and this is the result

add the function abc.setFixedWidthLayout()
add the function abc.setFixedWidthLayout()
Thanks! this worked!!
In case it helps, you can also use the layout property
new Table({
width: {...},
layout: "fixed",
rows: [...],
...
})
Btw could @zahrafali please close this issue?
Most helpful comment
add the function abc.setFixedWidthLayout()