Replies: 2   Views: 596
Align center 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 dev@ams  · 24-06-2020 - 11:42

Hi there,

How can I center align an image in my docx file using phpdocx?

Posted by dev@ams  · 24-06-2020 - 11:43

Forgot to add that we're using HTML embed.

Posted by admin  · 24-06-2020 - 12:06


Images can be aligned using a container that sets the align to be applied, for example using a paragraph or a table:

$html = '<p style="text-align: center;"><img src="image.png"></p>';