Aspose.Words.Examples.CSharp.Programming_Documents.Working_with_Tables.KeepTablesAndRowsBreaking.RowFormatDisableBreakAcrossPages C# (CSharp) Method

RowFormatDisableBreakAcrossPages() public static method

public static RowFormatDisableBreakAcrossPages ( string dataDir ) : void
dataDir string
return void
        public  static void RowFormatDisableBreakAcrossPages(string dataDir)
        {
            // ExStart:RowFormatDisableBreakAcrossPages
            Document doc = new Document(dataDir + "Table.TableAcrossPage.doc");

            // Retrieve the first table in the document.
            Table table = (Table)doc.GetChild(NodeType.Table, 0, true);            
            // Disable breaking across pages for all rows in the table.
            foreach (Row row in table)
                row.RowFormat.AllowBreakAcrossPages = false;

            dataDir = dataDir + "Table.DisableBreakAcrossPages_out.doc";
            doc.Save(dataDir);
            // ExEnd:RowFormatDisableBreakAcrossPages
            Console.WriteLine("\nTable rows breaking across pages for every row in a table disabled successfully.\nFile saved at " + dataDir);
        }
        public static void KeepTableTogether(string dataDir)