This project has moved. For the latest updates, please go here.

How to: break table rows across page

Jan 13, 2014 at 4:40 AM
I'm adding tables to my word document but I wish to make it so there can't be parts of a row on different pages. It looks weird when there is half a cell on one page and half a cell on the other page.

I couldn't find anything in the documentation or source code but maybe there is a workaround or something I've missed.
Jan 13, 2014 at 1:35 PM
Edited Jan 13, 2014 at 1:36 PM
I just created and uploaded a patch which allows you to set the BreakAcrossPages property for a Row.
This works like the Allow row to break across pages option in Word.

You can use it like this:
foreach (Row r in table.Rows)
{
    if (r.BreakAcrossPages == true)
    {
        r.BreakAcrossPages = false;
    }
}
Jan 13, 2014 at 7:12 PM
You are a scholar and a gentleman. Thank you very much!
Jan 14, 2014 at 9:09 AM
You're welcome, glad I could be of help :)
Oct 3, 2014 at 5:27 PM
Annika89 wrote:
I just created and uploaded a patch which allows you to set the BreakAcrossPages property for a Row.
This works like the Allow row to break across pages option in Word.

You can use it like this:
foreach (Row r in table.Rows)
{
    if (r.BreakAcrossPages == true)
    {
        r.BreakAcrossPages = false;
    }
}
Hi,
Where Can I get this patch? It would solve my problem...

Thank you in advance,

Alex
Oct 5, 2014 at 5:59 PM
You can get it from "Source Code" -> "Patches". It's the patch with ID 15710 (page 2). Or download this.
Since it has already been applied, you could also use the latest DocX source code.
Nov 7, 2014 at 12:11 AM
Thank you! Sorry for a long delay ; - )