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

ModifyCellFormatting() private static method

Shows how to modify formatting of a table cell.
private static ModifyCellFormatting ( string dataDir ) : void
dataDir string
return void
        private static void ModifyCellFormatting(string dataDir)
        {
            // ExStart:ModifyCellFormatting
            Document doc = new Document(dataDir + "Table.Document.doc"); 
            Table table = (Table)doc.GetChild(NodeType.Table, 0, true);

            // Retrieve the first cell in the table.
            Cell firstCell = table.FirstRow.FirstCell;
            // Modify some cell level properties.
            firstCell.CellFormat.Width = 30; // In points
            firstCell.CellFormat.Orientation = TextOrientation.Downward;
            firstCell.CellFormat.Shading.ForegroundPatternColor = Color.LightGreen;
            // ExEnd:ModifyCellFormatting
            Console.WriteLine("\nSome cell level properties modified successfully.");
        }
        /// <summary>