Forum


Replies: 3   Views: 29
Setting td widths using embedhtml

Posted by admin  · 24-04-2025 - 12:06

Hello,

We have run your script with phpdocx 14.5 and phpdocx 16, and both versions generate the same output.
Maybe you did some custom changes in your phpdocx 14.5 installation? If you send the HTML2WordML.php file from your phpdocx 14.5 to contact[at]phpdocx.com we'll compare it with the default version to check if any changes have been made.

All columns appear correctly if you open the DOCX outputs with MS Word. We have tested them with MS Word 2010, MS Word 2013, MS Word 2016, MS Word 2019, MS Word 2024, and MS Word 365.

Google Docs and MS Word Online also display six columns in the table.

It seems you are opening the DOCX with LibreOffice, which requires setting all (or none) cell widths to get a correct output. Please set all cell widths (or do not set cell widths to use auto sizes), but avoid adding widths to only some of the cells.

To get the maximum compatibility with all DOCX readers, we recommend setting table and cell widths when adding tables: https://www.phpdocx.com/documentation/cookbook/convert-html-to-word (Defining widths in tables section). All MS Word versions handle auto sizes correctly, but some DOCX readers have limitations in reading auto sizes.

Regards.