CellParentRow Property |
Namespace: Aspose.Words.Tables
// To keep a table from breaking across a page we need to enable KeepWithNext // for every paragraph in the table except for the last paragraphs in the last // row of the table foreach (Cell cell in table.GetChildNodes(NodeType.Cell, true).OfType<Cell>()) foreach (Paragraph para in cell.Paragraphs.OfType<Paragraph>()) { // Every paragraph that's inside a cell will have this flag set Assert.True(para.IsInCell); if (!(cell.ParentRow.IsLastRow && para.IsEndOfCell)) para.ParagraphFormat.KeepWithNext = true; }