You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a huge document in PHPWord that includes headings followed by paragraphs of text. I want to make sure that I don't wind up with a heading at the bottom of a sheet with the corresponding text on top of the next page. Since it's a dynamic document, there's no way to know where those breaks will fall ahead of time.
In CSS, there is an "Avoid Page Break" command. Is there anything similar in PHPWord? I have searched and can't find anything. I'm hoping someone out there has discovered it or knows a work around.
something similar to this, only in php rather than css...
I figured it out...in case anyone else is running into the same problem, within your paragraphStyle, use the setting:
'keepNext' => true
This engages a word setting that keeps a paragraph with whatever comes immediately after it. So if the paragraph following a heading is forced onto the next page, this will make sure that the heading goes with it.
I'm writing a huge document in PHPWord that includes headings followed by paragraphs of text. I want to make sure that I don't wind up with a heading at the bottom of a sheet with the corresponding text on top of the next page. Since it's a dynamic document, there's no way to know where those breaks will fall ahead of time.
In CSS, there is an "Avoid Page Break" command. Is there anything similar in PHPWord? I have searched and can't find anything. I'm hoping someone out there has discovered it or knows a work around.
something similar to this, only in php rather than css...
The text was updated successfully, but these errors were encountered: