Forum


Replies: 1   Views: 157
Top and bottom table cell margins using native docx to pdf
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  · 10-10-2024 - 09:56

Hello,

Please apply margins as cell styles instead of (or in addition to) table styles:

$tableValues = [
    [
        ['value' => 'One', 'cellMargin' => 400],
        ['value' => 'Two', 'cellMargin' => 400],
    ],
    [
        ['value' => 'Three', 'cellMargin' => 400],
        ['value' => 'Four', 'cellMargin' => 400],
    ],
    [
        ['value' => 'Five', 'cellMargin' => 400],
        ['value' => 'Six', 'cellMargin' => 400],
    ],
];

$docx = new CreateDocx();
$docx->addTable($tableValues);
$docx->createDocx('example.docx');

Regards.