Paragraph.InsertPagebreakafterSelf() is not working inside a table.

Aug 20, 2013 at 8:42 AM
Hi,

I Created a table with Docx and then i am trying to insert page break in a row. But it is just adding a new line. below is the code:

Paragraph cell_paragraph = Snap_table.Rows[0].Cells[0].Paragraphs[0];
cell_paragraph.InsertPageBreakAfterSelf();

Snap_table has 3 columns and i am doing this for all three columns. But it is just adding a new line in that row.

any solution will be greatly appreciated.

Thanks
Coordinator
Aug 26, 2013 at 4:26 PM
Can this be done in Microsoft Word?

I created a 3x3 table in Word 2012. Then in the first cell I typed abcdef. I then inserted a page break. The result was that the entire table moved to the second page.

Can you please verify that the effect you are trying to achieve is possible in using Word?

If Word cannot do it then DocX will not even try.
Oct 8, 2013 at 2:47 PM
Hi coffeycathal,

Yes, the effect is possible in word.

you created a 3x3 table in Word 2012. Then in the first cell you typed abcdef then inserted a page break. The result was that the entire table moved to the second page.

but , if the table is a long one, that is spread across more than 2 pages. If you will insert a page break in the middle pages. the result will be that the rest of the table will move to next page.

Please try this and any solution will be appreciated

Thanks