Hi,
I noticed an issue when trying to set the background color of a row in a wide table
var doc = new Document();
var page = doc.Pages.Add();
var mytable = new Table {Broken = TableBroken.VerticalInSamePage};
page.Paragraphs.Add(mytable);
mytable.ColumnWidths = "100 100 100 100 100 100";
var headerRow1 = mytable.Rows.Add();
for (var i=0; i<6; i++)
{
headerRow1.Cells.Add("header " + i);
}
headerRow1.BackgroundColor = Color.Parse("#C8C8C8");
for (var rowCounter = 0; rowCounter <= 2; rowCounter++)
{
var row1 = mytable.Rows.Add();
row1.Cells.Add("col " + rowCounter.ToString() + ", 1");
row1.Cells.Add("col " + rowCounter.ToString() + ", 2");
row1.Cells.Add("col " + rowCounter.ToString() + ", 3");
row1.Cells.Add("col " + rowCounter.ToString() + ", 4");
row1.Cells.Add("col " + rowCounter.ToString() + ", 5");
row1.Cells.Add("col " + rowCounter.ToString() + ", 6");
}
doc.Save("HeaderCellShadingBug.pdf");
In this example, if I make this change:
mytable.ColumnWidths = "50 50 50 50 50 50 ";
so that the table is no longer a wide-table, then the row background-color gets applied as I would expect. However for the wide table, the shading is not correctly applied to the cells of the row (see attached image). It looks like maybe the issue is only for the first row before the break.
header-row-background-color-bug.JPG (41.6 KB)