Place the image in the center of the cell using migradoc

I need to put the image in the center of the table cell. When I add an image to a cell, the image is aligned in height. How to align the image to the center of the cell?

+5
source share
2 answers
row.Cells[0].Format.Alignment = ParagraphAlignment.Center; row.Cells[0].VerticalAlignment = VerticalAlignment.Center; 
+3
source

You may need to add a paragraph to the cell, set the alignment to the paragraph, and then add the image to the paragraph.

 row.Cells[0].Format.Alignment = ParagraphAlignment.Center; row.Cells[0].VerticalAlignment = VerticalAlignment.Center; row.Cells[0].AddParagraph().AddImage(imageLocation); 
+6
source

Source: https://habr.com/ru/post/1204579/


All Articles