What you guys suggested is exactly what I'm trying to do. How do I achieve it?
I have a table and need to center the images in said table's cells, with even multiple images in a single cell.
From the given details, we have found that your requirement is to align an image in the center of a table cell. To achieve your requirement, we suggested you to set vertical alignment as Middle to VerticalAlignment API of the table cell and set horizontal alignment as Center to the HorizontalAlignment API of the paragraph. Please refer to the below-highlighted code snippet.
WTableCell cell = table[0, 1];
//Specifies the vertical alignment of content of text.
cell.CellFormat.VerticalAlignment = VerticalAlignment.Middle;
//Add paragraph to the table cell.
paragraph = cell.AddParagraph();
//Set horizantal alignment of the paragraph.
paragraph.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Center;
//Append picture to the paragraph.
We have prepared a sample application that demonstrates even when multiple images are present within a single cell how to align those images in the center of a table cell. It can be downloaded from the below,
Please refer to our below UG documentation to know more about how to work with the table in the Word document,
Refer to our below UG documentation to know more about how to work with images in the Word document,
Anto Nihil S