Thank you very much for your response. If the table needs to take more than one page, how can I repeat the header columns? I have tried this, following your example, but I can't get it working.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert few paragraphs at the beggining of the document
for (int i = 0; i < 20; i++)
builder.Writeln("This is paragraphs for testing");
// Enable "Keep with Next option"
builder.ParagraphFormat.KeepWithNext = true;
// Build some table
builder.CellFormat.Width = 200;
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Borders.Color = Color.Black;
builder.InsertCell();
builder.Write("Header Col1");
builder.InsertCell();
builder.Write("Header Col2");
builder.EndRow();
for (int i = 0; i < 100; i++)
{
for (int j = 0; j < 2; j++)
{
builder.InsertCell();
builder.Write("This is test content of the table");
}
builder.EndRow();
}
if (builder.ParagraphFormat.PageBreakBefore == true)
{
builder.InsertCell();
builder.Write("Header Col1");
builder.InsertCell();
builder.Write("Header Col2");
builder.EndRow();
}
builder.EndTable();
Thanks.
Denise