Forum


Replies: 1   Views: 1114
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 admin  · 22-09-2021 - 17:14

Hello,

If the custom table style is not being applied to the table and you get empty borders, then the style ID used with addTable is not correct. Also please note you need to apply the style ID, not the style name.

Please check and run the sample Core/addTable/sample_2.php.

The default base template of phpdocx includes LightListAccent1PHPDOCX as custom table style and others, but as you are using a custom template:

$docx = new CreateDocxFromTemplate($input_file);

it doesn't contain LightListAccent1PHPDOCX as custom stable style (unless you create or import it). We recommend you to check the style ID of the custom table style to be applied using parseStyles or Indexer. If you attach or send to contact[at]phpdocx.com the DOCX that contains the table style you want to apply, we'll check it and generate and sample script using addTable.

Regards.