It seems that floating images inside table cells do not work as intended.
As a workaround, I used a separate column for the image.
My test code:
Code:
var table = section.AddTable();
table.AddColumn("7cm");
table.AddColumn("12mm");
table.AddColumn("7cm");
var row = table.AddRow();
var paragraph = row.Cells[0].AddParagraph("First Column");
row.Cells[0].VerticalAlignment = VerticalAlignment.Center;
var image = row.Cells[1].AddImage(@"C:\Users\thho\Pictures\ProgMan.png");
image.Height = "10mm";
paragraph = row.Cells[2].AddParagraph();
paragraph.AddText(" Second Column");
row.Cells[2].VerticalAlignment = VerticalAlignment.Center;
row.Cells[1].Borders.Right.Visible = false;
row.Cells[2].Borders.Left.Visible = false;
table.Borders.Width = 1;
And the results:
Attachment:
DummyColumn.png [ 5.68 KiB | Viewed 28495 times ]
You can set the borders to make the column invisible.
For rows that don't have an image, you can set MergeRight to 1 and put the text into the image column. Same for header row.
I hope this helps.