Forum


Replies: 1   Views: 71
Top and bottom table cell margins using native docx to pdf

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.