We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Switch from percent to inches

Hi,

in Word, I can switch the table width from % to inches by a dialog click
and the prefered width in points is automatically calculated.

How can I do it with Aspose ?

Regards,

@Nachti You can auto fit the table with AutoFitBehavior.FixedColumnWidths to force Aspose.Words recalculate widths of table and cells in absolute units:

Document doc = new Document("C:\\Temp\\in.docx");

foreach (Table t in doc.GetChildNodes(NodeType.Table, true))
    t.AutoFit(AutoFitBehavior.FixedColumnWidths);

doc.Save("C:\\Temp\\out.docx");