Hello,
We have run the following script using all versions of PHP from 5.2.11 to 7.4 and in all cases there's no extra space:
require_once 'classes/CreateDocx.php';
$docx = new CreateDocx();
$html = '
<table>
<tbody>
<tr>
<td style="border-bottom:solid #000000;border-left:solid #000000;border-right:solid #000000;border-top:solid #000000;width:20%;">Test</td>
<td style="border-bottom:solid #000000;border-left:solid #000000;border-right:solid #000000;border-top:solid #000000;width:80%;">Has extra space in front when <strong>bold</strong> is used</td>
</tr>
</tbody>
</table>
';
$options = array(
'parseDivs' => 'paragraph',
'addDefaultStyles' => true,
'disableWrapValue' => true,
'useHTMLExtended' => true,
'downloadImages' => true,
'parseFloats' => true,
'strictWordStyles' => false,
);
$docx->embedHTML($html, $options);
$docx->createDocx('output');
Please send to contact[at]phpdocx.com the following information:
- DOCX output that contains the extra blank space, for example the output of running the previous code on your server.
- PHP version and phpdocx version you are using.
- Program and version you are using to open it.
so we can check it. removeLineBreaks in phpdocx 10 should only remove extra line breaks added by Tidy but not other line breaks, maybe you are using an old version of phpdocx?
Regards.