Forum


Replies: 1   Views: 1075
Create table with tablestyle into existing docx file
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 danilo  · 22-09-2021 - 15:28

I've tried to create a table into an existing file using this code.

$docx = new CreateDocxFromTemplate($input_file);

...

$docx->addTable(
    array(array('Title A','Title B','Title C'),array('First row A','First row B','First row C'),array('Second row A','Second row B','Second row C')),
    array('tableStyle' => 'LightListAccent1PHPDOCX', 'columnWidths' => array(1800, 1800, 1800))
);

The resulting table have no style (no borders, no fonts, black color).

I've tryed also other styles found with parseStyles method with no success.

If I create a custom style, and use it in the table, it works in the existing docx file...