Replies: 4   Views: 927
How do i create a two columns document with different background color/image..
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 admin  · 07-11-2021 - 09:28


The easiest approach to accomplish that task is generating a DOCX document using MS Word, LibreOffice or any other DOCX editor with the layout you want to use and load it as template. Then use the template methods included in phpdocx to replace and add contents, and customize styles if needed (for example changing the background color dynamically) using DOCXCustomizer.

If you need to generate it from scratch you should use a layout with custom margins using modifyPageLayout, or phpdocx_modifypagelayout using HTML Extended; and then add a fixed table that fills the whole page using embedHTML (height style applied to tr tags and table-layout style applied to table tags) or addTable (tableLayout and height options). On you can read all attributes and styles supported when adding tables using HTML.