Trying to put table inside table. Internal table does not spans over parent table and always remains in one cell despite CellMerge.
[Test]
public void TableInsideTable()
{
var doc = new Document();
var db = new DocumentBuilder(doc);
// table
var table = db.StartTable();
var cell1 = db.InsertCell();
// cell1.CellFormat.HorizontalMerge = CellMerge.First; /* uncommenting this makes output wierd. */
var cell2 = db.InsertCell();
cell2.CellFormat.HorizontalMerge = CellMerge.Previous;
// subtable
var subTable = db.StartTable();
var subCell1 = db.InsertCell();
db.Write("subTable.col1");
var subCell2 = db.InsertCell();
db.Write("subTable.col2");
var subCell3 = db.InsertCell();
db.Write("subTable.col3");
db.EndRow();
db.EndTable();
// table
db.EndRow();
db.InsertCell();
db.Write("table.col1");
db.InsertCell();
db.Write("table.col2");
db.EndRow();
db.EndTable();
doc.Save(@"C:\out.docx");
}
Result is always disappointing whatever I do as sub table remains in one parent cell. Results attached.
Thank you for help!