I have a document with few tables. The first table is split at end of its page (see input.docx (12.2 KB)). I applied this code to put the table in the following page.
import aspose.words as aw
doc = aw.Document("input.docx")
table = doc.get_child(aw.NodeType.TABLE, 0, True).as_table()
for cell in table.get_child_nodes(aw.NodeType.CELL, True):
cell = cell.as_cell()
cell.ensure_minimum()
for para in cell.paragraphs:
para = para.as_paragraph()
if not (cell.parent_row.is_last_row and para.is_end_of_cell):
para.paragraph_format.keep_with_next = True
doc.save("keep_table.docx")
As a result, the first table was placed in the beginning of the following page (hence not split anymore), but the second table became split.
How can I have all tables in the document not splited?
Any help is appreciated.