Forum


Replies: 2   Views: 123
Align center image

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

Hello,

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>';
$docx->embedHTML($html);

Regards.