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

Free Support Forum - aspose.com

How to get the horizontal alignment

Hi

How to get horizontal alignment of

Aspose.Words.Tables.Cell That is how to know the cell value is right or left aligned

Hi Ajeesh,


Thanks for your request.

A minimal valid cell needs to have at least one Paragraph. Horizontal alignment of text inside table cells is specified as alignment of paragraphs inside those cells. So, you need to get the horizontal alignment for the paragraphs inside the cells.

Best Regards,

how to get the horizontal alignment of paragraph

Hi
Ajeesh,


Thanks for your inquiry. You can use ParagraphFormat.Alignment property as follows:

Table tab = doc.FirstSection.Body.Tables[0];

Cell c = tab.Rows[0].Cells[2];

Paragraph p = c.FirstParagraph;

Console.WriteLine(p.ParagraphFormat.Alignment);


Best Regards,

I managed to find i solution: I had to set the alignment of all other paragraphs in the table to the left.