Forum


Replies: 1   Views: 144
Html fragment in a docx file: avoid page breaks between heading and content and in tables
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by ralfjahr  · 22-08-2024 - 08:19

We are adding several sections with section headline, paragraphs and tables to word files. The data is prepared as HTML and then added to the docx file (premium license). Is there a way to avoid page breaks between the section headline, the paragraphs and (especially in) a table?

We tried "page-break-inside: avoid;" and "page-break-after: avoid;" (https://www.phpdocx.com/documentation/snippets/prevent-page-break-paragraph-html) but were not successful. Where do we need to position these css attributes? Any magic trick which we forgot? 

Thanks!