How to apply styles on table without using DocumentBuilder class?

I want to know that if I have to set styles on the table and I am not using DocumentBuilder class for making table is their any other way?


Basically, to apply styles to the table you need to enumerate through all relevant nodes inside Table object and set the desired style directly to them. Please note that Aspose.Words does support setting paragraph, character and list styles. Table styels are not supported yet.

For example, to apply paragraph or character styles to the table content you can use the following code:

foreach (Paragraph para in table.GetChildNodes(NodeType.Paragraph, true))


para.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading1;


You can also use StyleName property instead of StyleIdentifier to apply user-created styles.

Best regards,