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.
Hi,
is there a way to define the width for a table column and second question would it be possible to give the L1 rows a different background color than the L2 rows?
[code]
require_once 'classes/CreateDocx.inc';
$docx = new CreateDocx();
$valuesTable = array(
array(
'L1',
'L1'
),
array(
'L2',
'L2'
),
);
$paramsTable = array(
'border' => 'single',
'border_sz' => 20
);
$docx->addTable($valuesTable, $paramsTable);
$docx->createDocx('example_table');
[/code]
Thanks for your help
Hello,
Please check examples/easyTable_size_cols.php and testTable_color.php files. Only available for phpdocx pro.
Regards.
Hi,
just got the sources and the activiation code however I am not able to locate the color example. Can you point me to the locations were this is suposed to stay?
... and another problem. When I apply the table width array as outlined in the Table_size_cols.php to a regular table - everythink works. If I try to apply it to a table like described in TableStyled.php it is beeing ignored.
For TableStyled liked tables only single values are exepted in the params array:
[code]
$docx_params_table_1 = array(
'border' => 'single',
'border_sz' => 2,
'border_spacing' => 0,
'border_color' => '000000',
'size_col' =>[b] 2500[/b]
);
[/code]
Arrays are not going to work:
[code]
$docx_params_table_1 = array(
'border' => 'single',
'border_sz' => 2,
'border_spacing' => 0,
'border_color' => '000000',
'size_col' => [b]array(3000,1500,1500)[/b]
);
[/code]
How can I apply different column width to styled tables?
Kind regards,
aha found the solution. I had an error in one of my style array's which did not raise an PHP - Error -> strange. But anyway fixing that error solved the width problem as well.
... I also found the Test - folder which contains examples of the undocumented "'cell_color' => 'FFFFFF'," paramanter which works as expected as well.