Hi,
thanks for your fast reply.
I tried all three, coloring the background of the columns, of the table and of the rows, and nothing seems to be able to remove the white space between the two columns. I guess the white space there is just not part of anything in the table.
My source looks now like this (myTable1 is the one with the column colors, myTable2 the one with the color in the table):
Code:
PdfDocument outputPdf = new PdfDocument();
PdfPage page0 = outputPdf.AddPage();
Document doc = new Document();
Section tableSection = doc.AddSection();
/* Table containing Columns with background color */
Table myTable1 = tableSection.AddTable();
Column table1_column1 = myTable1.AddColumn(Unit.FromCentimeter(10));
Column table1_column2 = myTable1.AddColumn(Unit.FromCentimeter(5));
table1_column1.Format.Shading.Color = Color.FromRgbColor((byte)255, Color.Parse("0xaaeeaa"));
table1_column2.Format.Shading.Color = Color.FromRgbColor((byte)255, Color.Parse("0xaaeeaa"));
Row table1_rowWithoutColor = myTable1.AddRow();
table1_rowWithoutColor.Cells[0].AddParagraph("Row without color, Cell 1");
table1_rowWithoutColor.Cells[1].AddParagraph("Row without color, Cell 2");
string color1 = "0xd5dadc";
string color2 = "0xb2b9be";
bool colorAlter = true;
for(int i = 0; i < 5; i++)
{
Row row = myTable1.AddRow();
row.Format.Shading.Color = Color.FromRgbColor((byte)255, Color.Parse(colorAlter ? color1 : color2));
row.Cells[0].AddParagraph("Row " + i + ", Cell 1");
row.Cells[1].AddParagraph("Row " + i + ", Cell 2");
colorAlter = !colorAlter;
}
/* placeholder */
tableSection.AddParagraph("\n\n");
/* Table with Background color */
Table myTable2 = tableSection.AddTable();
myTable2.Format.Shading.Color = Color.FromRgbColor((byte)255, Color.Parse("0xeeeeee"));
Column table2_column1 = myTable2.AddColumn(Unit.FromCentimeter(10));
Column table2_column2 = myTable2.AddColumn(Unit.FromCentimeter(5));
Row table2_rowWithoutColor = myTable2.AddRow();
table2_rowWithoutColor.Cells[0].AddParagraph("Row without color, Cell 1");
table2_rowWithoutColor.Cells[1].AddParagraph("Row without color, Cell 2");
DocumentRenderer docRenderer = new MigraDoc.Rendering.DocumentRenderer(doc);
docRenderer.PrepareDocument();
XGraphics gfx = XGraphics.FromPdfPage(page0);
docRenderer.RenderPage(gfx, 1, PageRenderOptions.All);
outputPdf.Save("TablesTest1.pdf");
Process.Start("TablesTest1.pdf");
And here is what the result looks like:
![Image](http://www.paeppi.com/tabletest2_snapshot.jpg)