Table within a table

Nov 16, 2012 at 1:30 PM

Is it possible to do that?

 

I tried this

  var table1 = _document.InsertTable(5, 3);
            table1.SetBorder(TableBorderType.Left, new Novacode.Border() { Color = System.Drawing.Color.Blue, Size = BorderSize.two, Tcbs = BorderStyle.Tcbs_single });

            var table2 = _document.InsertTable(2, 2);
            table2.Rows[0].Cells[0].Paragraphs[0].InsertText("hi");

            table1.Rows[1].Cells[1].Tables.Add(table2);
But it seems like it is just inserting under the table below table1 in my document which just makes it two separate tables.

Nov 17, 2012 at 4:42 AM

yes , just use ( InsertTableBeforeSelf ) method  like ( table2.Rows[0].Cells[1].Paragraphs[0].InsertTableBeforeSelf(table2); )



Nov 17, 2012 at 5:38 PM

Thanks, that worked.