ApiExamples.ExTable.NestedTablesUsingNodeConstructors C# (CSharp) Метод

NestedTablesUsingNodeConstructors() приватный Метод

private NestedTablesUsingNodeConstructors ( ) : void
Результат void
        public void NestedTablesUsingNodeConstructors()
        {
            Document doc = new Document();

            // Create the outer table with three rows and four columns.
            Table outerTable = this.CreateTable(doc, 3, 4, "Outer Table");
            // Add it to the document body.
            doc.FirstSection.Body.AppendChild(outerTable);

            // Create another table with two rows and two columns.
            Table innerTable = this.CreateTable(doc, 2, 2, "Inner Table");
            // Add this table to the first cell of the outer table.
            outerTable.FirstRow.FirstCell.AppendChild(innerTable);

            doc.Save(MyDir + @"\Artifacts\Table.CreateNestedTable.doc");

            Assert.AreEqual(2, doc.GetChildNodes(NodeType.Table, true).Count); // ExSkip
            Assert.AreEqual(1, outerTable.FirstRow.FirstCell.Tables.Count); //ExSkip
            Assert.AreEqual(16, outerTable.GetChildNodes(NodeType.Cell, true).Count); //ExSkip
            Assert.AreEqual(4, innerTable.GetChildNodes(NodeType.Cell, true).Count); //ExSkip
        }