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

ApplyRowFormatting() private static method

Shows how to create a table that contains a single cell and apply row formatting.
private static ApplyRowFormatting ( string dataDir ) : void
dataDir string
return void
        private static void ApplyRowFormatting(string dataDir)
        {
            // ExStart:ApplyRowFormatting
            Document doc = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            Table table = builder.StartTable();
            builder.InsertCell();

            // Set the row formatting
            RowFormat rowFormat = builder.RowFormat;
            rowFormat.Height = 100;
            rowFormat.HeightRule = HeightRule.Exactly;
            // These formatting properties are set on the table and are applied to all rows in the table.
            table.LeftPadding = 30;
            table.RightPadding = 30;
            table.TopPadding = 30;
            table.BottomPadding = 30;

            builder.Writeln("I'm a wonderful formatted row.");

            builder.EndRow();
            builder.EndTable();

            dataDir = dataDir + "Table.ApplyRowFormatting_out.doc";

            // Save the document to disk.
            doc.Save(dataDir);
            // ExEnd:ApplyRowFormatting
            Console.WriteLine("\nRow formatting applied successfully.\nFile saved at " + dataDir);
        }
        /// <summary>