Forum


Replies: 4   Views: 2963
Table columnwidths
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 neiron  · 10-11-2016 - 14:29

I have the header in level 2, I list the width of the columns, if params columnWidht is dimensional array?

Thank you!

Posted by admin  · 11-11-2016 - 09:39

Hello,

This is a sample of using columnWidths:

$valuesTable = array(
    array(
        'Title A',
        'Title B',
        'Title C'
    ),
    array(
        'Line A',
        $link,
        $image
    )
);


$paramsTable = array(
    'tableStyle' => 'LightListAccent1PHPDOCX',
    'tableAlign' => 'center',
    'columnWidths' => array(1000, 2500, 3000),
    );

$docx->addTable($valuesTable, $paramsTable);

Regards.

Posted by neiron  · 11-11-2016 - 10:58

No, I have 2 level header. See in the picture

https://cloud.mail.ru/public/LU3f/XATebEGak

 

Posted by admin  · 11-11-2016 - 11:18

Hello,

We recommend you to use the embedHtml method or a template to create tables like the one you refer.

Regards.

Posted by neiron  · 14-11-2016 - 11:18

Thank you!