Forum


Replies: 2   Views: 1615
Unwanted space at beginning of table cell
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 dev@ams  · 14-07-2020 - 09:47

Hi,

We do get an unwanted space in docx files generated with phpdocx at the beginning of table cells.

It happens for example in this case:

<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>

WIth the following embedhtml settings:

'parseDivs'        => 'paragraph',
            'addDefaultStyles' => true,
            'disableWrapValue' => true,
            'useHTMLExtended'  => true,
            'downloadImages'   => true,
            'parseFloats'      => true,
            'strictWordStyles' => false,

We already tried it using `removeLineBreaks`, but that removes other spaces that we don't want to have removed.

What causes these spaces and how can we prevent these?