Reputation: 255
In Word there is a property "keep with next" under Paragraph > Line and Page Breaks. I was wondering if there is a way to set this property to a table created using Novacode DocX
Upvotes: 2
Views: 812
Reputation: 155
Yes, set the paragraph of at least one cell in every row in the table using KeepWithNext(true). If you are building your tables dynamically, then this is easy to do.
Novacode.Table t = doc.InsertTable(2, 3); // 2 rows; 3 columns
t.Rows[0].Cells[0].Paragraphs[0].Append("A1").KeepWithNext(true);
t.Rows[0].Cells[1].Paragraphs[0].Append("B1");
t.Rows[0].Cells[2].Paragraphs[0].Append("C1");
t.Rows[0].Cells[0].Paragraphs[0].KeepWithNext(true);
t.Rows[1].Cells[0].Paragraphs[0].Append("A2").KeepWithNext(true);
t.Rows[1].Cells[1].Paragraphs[0].Append("B2");
t.Rows[1].Cells[2].Paragraphs[0].Append("C2");
Upvotes: 0