Hi,
// Added document
Document doc = new Document();
Aspose.Pdf.Page page = doc.Pages.Add();
//Instantiate a table object
Aspose.Pdf.Table mytable = new Aspose.Pdf.Table();
mytable.Broken = TableBroken.Vertical;
//Add the table in paragraphs collection of the desired section
page.Paragraphs.Add(mytable);
//Set with column widths of the table
mytable.ColumnWidths = “100 100 100 100 100 100”;
//Add colspan header Row
Aspose.Pdf.Row headerRow1 = mytable.Rows.Add();
var firstspan = headerRow1.Cells.Add("header span 3");
firstspan.ColSpan = 3;
firstspan.BackgroundColor = Color.LightBlue;
//Breaks because the colspan cell is split between multiple pages
var secondspan = headerRow1.Cells.Add("header span 3");
//secondspan.ColSpan = 3;
secondspan.BackgroundColor = Color.LightGreen;
//Add header Row 2
Aspose.Pdf.Row headerRow2 = mytable.Rows.Add();
headerRow2.Cells.Add("header 1");
headerRow2.Cells.Add("header 2");
headerRow2.Cells.Add("header 3");
headerRow2.Cells.Add("header 4");
headerRow2.Cells.Add("header 5");
headerRow2.Cells.Add("header 6");
for (int RowCounter = 0; RowCounter <= 5; RowCounter++)
{
//Create rows in the table and then cells in the rows
Aspose.Pdf.Row 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("BrokenWideTableColSpans.pdf");</code></pre></div>