Forum


Replies: 5   Views: 3246
Html table default cellmarges
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  · 08-01-2018 - 09:05

Hello again,

Doing some more checks, we think that maybe you are not trying to change the cell option margins (Cell tab in the Table Properties) but the Default cell margins value (Table tab in the Table Properties). The previous patch changes cell option margin values, not default cell margings.

This Default cell margins are applied using a MS Word style. If you want to change it, please set a custom MS Word style to the table when importing the HTML, or if you want to apply it for all tables, you could overwrite the default style in the OOXMLResources.inc file:

<w:style w:type="table" w:styleId="NormalTablePHPDOCX">
    <w:name w:val="Normal Table PHPDOCX"/>
    <w:uiPriority w:val="99"/>
    <w:semiHidden/>
    <w:unhideWhenUsed/>
    <w:qFormat/>
    <w:pPr>
        <w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
    </w:pPr>
    <w:tblPr>
        <w:tblInd w:w="0" w:type="dxa"/>
        <w:tblCellMar>
            <w:top w:w="0" w:type="dxa"/>
            <w:left w:w="108" w:type="dxa"/>
            <w:bottom w:w="0" w:type="dxa"/>
            <w:right w:w="108" w:type="dxa"/>
        </w:tblCellMar>
    </w:tblPr>
</w:style>

You can change both w:left and w:right tags, setting w:w="0" to change the default behavior.

Regards.