Forum


Replies: 1   Views: 3093
Html table with dynamic columns
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 cocciagialla  · 22-12-2016 - 11:33

HI,

I need to embed an html table within a docx and transform it to pdf with libreoffice library.

This table has one column with fixed size and an unknown number of columns, these must to be auto sized.

Like that:

<table>
<tr>
<td width="10%">N.</td>
<td>N.</td>
<td>N.</td>
...
</tr>
</table>

Actually all columns appears to be the same width in the pdf.

I read that each columns need to have a defined width, but is there a way to do not have to define width attribute?

I use PhpDocx6.5 Pro with LibreOffice v 5.1.6.1

Thanks
Gianluigi

Posted by admin  · 22-12-2016 - 16:24

Hello,

If you are importing HTML you need set the table and cols width to get a correct output opening the document with LibreOffice or OpenOffice. If you use the addTable method to generate the tables you need to set these values as well.

MS Word sets a default auto value, but LibreOfffice doesn't.

Regards.