Forum


Replies: 3   Views: 5112
Image center alignment in table td
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 labuser  · 24-09-2015 - 12:00

i create a html table in php using style tags in the td element, eg. one row: tr td style="text-align:left;"img src="...." width="355"/td td style="width:10%;"/td td style="text-align:right;"img src="..." width="355"/td /tr (of course i use < and >) but the text-align statement, has no effect in word (in html it gets displayed correctly), the images inside the table are all left, what shall i do? Our PHP docx version is 4.1.

Posted by admin  · 25-09-2015 - 07:46

Hello, Please try using the align attribute in the tag image. Regards.

Posted by labuser  · 25-09-2015 - 09:43

Hello, We have already try that but did not work it. It is work for left & right possession but did not work for centre so please let me know on same.

Posted by admin  · 25-09-2015 - 11:57

Hello, There's no support to align the image value as center. You can easily add support changing the HTML2WordML.inc file, and replacing this line (around 1038): if (isset($properties['float']) && ($properties['float'] == 'left' || $properties['float'] == 'right')) { by: if (isset($properties['float']) && ($properties['float'] == 'left' || $properties['float'] == 'right' || $properties['float'] == 'center')) { And this patch: --- a/lib/dompdfParser/include/styleparser.cls.php +++ b/lib/dompdfParser/include/styleparser.cls.php @@ -132,7 +132,7 @@ class StyleParser { "display" => "inline", //"elevation" => "level", //"empty_cells" => "show", - "float" => "none", + "float" => "center" Regards.