Menu

Autofit Setting to Tables

Shoaib

Aspose.Words - Autofit Setting to Tables

// Open the document
Document doc = new Document(dataPath + "tableDoc.doc");

Table table = (Table)doc.getChild(NodeType.TABLE, 0, true);
// Autofit the first table to the page width.
table.autoFit(AutoFitBehavior.AUTO_FIT_TO_WINDOW);

Table table2 = (Table)doc.getChild(NodeType.TABLE, 1, true);
// Auto fit the table to the cell contents
table2.autoFit(AutoFitBehavior.AUTO_FIT_TO_CONTENTS);

Download Source Code

For More Examples, Please Visit Aspose Docs


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.