Free Support Forum - aspose.com

Center text witin each cell

I want to be able to center the text witin a cell. I am using InsertCell and Write function to create the cell.

Thanks

The alignment of text inside table cells is controlled by the alignment of its paragraphs.

To change paragraph alignment to 'centered' use the following code after calling DocumentBuilder.Write:

builder.CurrentParagraph.ParagraphFormat.Alignment = ParagraphAlignment.Center;