Can I make a table https://cloud.mail.ru/public/LU3f/XATebEGak ?
Those. values in cells through affix substitutes, but in some areas is the union of cells, both vertically and horizontally
Can I make a table https://cloud.mail.ru/public/LU3f/XATebEGak ?
Those. values in cells through affix substitutes, but in some areas is the union of cells, both vertically and horizontally
Hello,
Yes, phpdocx allows to do tables such as the indicated. You could do that using the embedHtml method or templates.
Regards.
I need to use the templates as It planned that the user will create a template and specify which fields he wants in the table.
Example table (template docx-file):
____________________________________________
|_____________$header$___________________|
|___$val1$___|___$val2$___|___ $val3$___|
$docx = new CreateDocxFromTemplate('../../files/TemplateSimpleTable.docx');
$data = array(
array(
'val1' => '1',
'val2' => '2',
'val3' => '3',
),
array(
'val1' => '4',
'val2' => '5',
'val3' => '6',
),
array(
'val1' => '7',
'val2' => '8',
'val3' => '9',
),
);
$docx->replaceTableVariable($data, array('parseLineBreaks' => true));
$docx->createDocx('example_replaceTableVariable_1');
The number of rows I do not know in advance. Those. is N-lines. Then he will go again connected cells, then again a lot of lines, etc.
https://cloud.mail.ru/public/DCSk/1kqNusQs2
I need to get through the templates like this table
Neiron my colleague. We use Pro version 5.5
It is clear that we can automatically generate a table. But we need to get the user himself can define a template for the table, he needed columns and styles for them.
Hello,
The method replaceTableVariable allows to add any values in a table; but it doesn't allow to add values then a header in the same table then values again... and so on.
You'll need to generated distinct tables for each set of values or generate the tables dynamically (using addTable or embedHtml or replaceVariableByHTML).
The next version of phpdocx will include, only for Corporate and Enterprise licenses, a new class called DOCXPATH that will ease tasks that the one you need.
Regards.