Forum


Replies: 0   Views: 3648
Multiple rows in template tables with different variables names
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 jbernard  · 21-05-2015 - 10:14

Hello, I have to work with a specific type of tables, witch has different kind of rows. For exemple, cell's content of my first row have to be bold, my second and third rows are normal and my fourth row has to be bold again. Finally, my last row is normal. Here is the code i'm using : $table = array( array( 'CATEGORY' => 'FooBar', 'DATE_CATEG' => '', 'TOTAL_CATEG_1' => '', 'TOTAL_CATEG_2' => '', 'TOTAL_CATEG_3' => '600 000', 'TOTAL_CATEG' => '600 000', 'DETENTION_CATEG' => '', ), array( 'TYPE' => 'Foo', 'DATE' => '01/01/2000', 'TYPE_1' => '', 'TYPE_2' => '', 'TYPE_3' => '350 000', 'TOTAL' => '350 000', 'DETENTION' => '', ), array( 'TYPE' => 'Bar', 'DATE' => '01/01/2010', 'TYPE_1' => '', 'TYPE_2' => '', 'TYPE_3' => '250 000', 'TOTAL' => '250 000', 'DETENTION' => '', ), array( 'CATEGORY' => 'BarBar', 'DATE_CATEG' => '', 'TOTAL_CATEG_1' => '', 'TOTAL_CATEG_2' => '', 'TOTAL_CATEG_3' => '350 000', 'TOTAL_CATEG' => '350 000', 'DETENTION_CATEG' => '', ), array( 'TYPE' => 'Bar', 'DATE' => '01/01/2015', 'TYPE_1' => '', 'TYPE_2' => '', 'TYPE_3' => '350 000', 'TOTAL' => '350 000', 'DETENTION' => '', ), ); $docx = new \CreateDocxFromTemplate('myTemplateFile.docx'); $docx->replaceTableVariable($table); $docx->createDocx('myModifiedFile.docx'); Unfortunatly, this code fills only the bold rows while the other rows (the second, the third and the fifth) are only created and remain empty. Have you an idea to resolve this ? Is this a known issue from the library ? I'm currencly using your Pro trial version for testing purpose. Thanks for your help.