Forum


Replies: 2   Views: 4174
Adding text + list within a table cell or mulit-element array
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 ardigital  · 11-06-2012 - 19:17

Hi all,

Hoping you can help, I'm trying to add a Text and a List into a single table cell, esentially a multi-type "addElement" array, is this possible?

At present I have:

$mList = array('list1', 'list2');
$myList = $docx->addElement('addList', array($mList, array('val' => 1))); // this works fine

$description = array($docx->addElement('addText', 'hello'), $myList); // problem line

// Create Table
$tableValues[] = array($description, "item2", "item3", "item4");

$paramsTable = array(
'border' => 'single',
'border_sz' => 10,
'size_col' => 2500
);

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

Any help would be great

Andy

Posted by admin  · 11-04-2013 - 12:13

Hello,

We recommend you to create a DOCX and use it as a template. Just insert as many placeholders as needed and then open this files an replace placeholders with any value (texts, lists, tables, HTML...).

Regards.