You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that problem is in src/PhpWord/Element/Cell.php::__construct.
When I use \PhpOffice\PhpWord\Shared\Html::addHtml for parsing html fragment: <table> <tr> <td style="width:10%;">10%</td> <td style="width:90%;">90%</td> </tr> </table>
width not working, because method src/PhpWord/Shared/Html::parseCell make Cell instanse without width from style attribute.
[UPDATE 1] /21.06.2022
Yes. There is problem in src/PhpWord/Style/Cell::setWidth. The method does not assign anything. And for now I don't know how to fix it.
[UPDATE 2] /21.06.2022
This is my hotfix for my task. If you know how many columns you have you can set width directly for first row (see screenshots down). Mybe this is solution is not correct/not nice, but for me this is works...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.
Hi,
I need to create a word file from PHP. I create a HTML string into PHP and use PhpWord to create a file
`$phpWord = new \PhpOffice\PhpWord\PhpWord();
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $html);
`
This is my simple table:
unfortunately I can't share the table code in this post
`
`Unfortunatly the column width is not recognized. the column width is adapted to the content.
How can I solve the problem? Could you please help me?
Thanks
L
The text was updated successfully, but these errors were encountered: