Forum


Replies: 4   Views: 909
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  · 08-11-2021 - 07:36

Hello,

Please note that the allowed values when applying height to tr tags (as explained on https://www.phpdocx.com/htmlapi-documentation/html-standard/insert-table-Word-document-with-HTML), are the following:

height     length: em, pt, px

You need to use a fixed size to apply a tr height.

About your question, there's no way to prevent repeating a background image, MS Word repeats it automatically. You can get section sizes using the Indexer class (https://www.phpdocx.com/api-documentation/docxutilities/indexer-parse-word-documents-with-PHP). For your reference A4 has the following size: 

'width' => '11906',
'height' => '16838',

set as twentieths of a point (https://www.phpdocx.com/documentation/cookbook/word-units-measure).

HTML Extended, available in Premium licenses, includes the phpdocx_image tag (https://www.phpdocx.com/htmlapi-documentation/html-extended/insert-image-Word-document-with-HTML) that supports extra options such as relativeToHorizontal, relativeToVertical, textWrap and others). This tag may be useful for your needs.

Regards.