Forum


Replies: 3   Views: 1307
Phpdocx_link is adding/removing breaks
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 admin  · 06-04-2021 - 11:02

Hello,

We have run the following code and it works correctly:

$html = '<span>Content</span> <b><phpdocx_link data-text="My Link" data-url="https://www.phpdocx.com" /></b>';
$docx->embedHTML($html, array('useHTMLExtended' => true));

$html = '<span>Content</span> <phpdocx_link data-text="My Link" data-url="https://www.phpdocx.com" />';
$docx->embedHTML($html, array('useHTMLExtended' => true));

We think the problem doesn't come from the phpdocx_link tag but the default behaviour of tables in MS Word, if a content exceeds the cell margin as seems the case (adding a link or not and the blank spaces added to the contents may vary the content size), an automatic line break is done.
We recommend you to test the previous script and your code out of table contents to check if this is the case. And also test using an a tag instead of phpdocx_link to check if you get the same output.

If you send to contact[at]phpdocx.com your DOCX we'll check it to know the exact source of that behaviour.

Regards.