Aspose.Words.Examples.CSharp.Programming_Documents.Working_with_Tables.ApplyFormatting.BuildTableWithBordersEnabled C# (CSharp) Method

BuildTableWithBordersEnabled() private static method

Shows how to build a table with all borders enabled (grid).
private static BuildTableWithBordersEnabled ( string dataDir ) : void
dataDir string
return void
        private static void BuildTableWithBordersEnabled(string dataDir)
        {
            // ExStart:BuildTableWithBordersEnabled
            Document doc = new Document(dataDir + "Table.EmptyTable.doc");

            Table table = (Table)doc.GetChild(NodeType.Table, 0, true);
            // Clear any existing borders from the table.
            table.ClearBorders();
            // Set a green border around and inside the table.
            table.SetBorders(LineStyle.Single, 1.5, Color.Green);

            dataDir = dataDir + "Table.SetAllBorders_out.doc";
            // Save the document to disk.
            doc.Save(dataDir);
            // ExEnd:BuildTableWithBordersEnabled
            Console.WriteLine("\nTable build successfully with all borders enabled.\nFile saved at " + dataDir);
        }
        /// <summary>