How to set the width of columns?
tableData:width OR tableProperties: columnWidths?
If I have a simple table that works: columnWidths
But my table have WordFragment then columnWidths not working
How to set the width of columns?
tableData:width OR tableProperties: columnWidths?
If I have a simple table that works: columnWidths
But my table have WordFragment then columnWidths not working
Hello,
This sample uses columnWidths and WordFragments (it's included within all packages as example):
<?php
require_once 'classes/CreateDocx.inc';
$docx = new CreateDocx();
// create a few Word fragments to insert rich content in a table
$link = new WordFragment($docx);
$options = array(
'url' => 'http://www.google.es'
);
$link->addLink('Link to Google', $options);
$image = new WordFragment($docx);
$options = array(
'src' => '../../img/image.png'
);
$image->addImage($options);
$valuesTable = array(
array(
'Title A',
'Title B',
'Title C'
),
array(
'Line A',
$link,
$image
)
);
$paramsTable = array(
'tableStyle' => 'LightListAccent1PHPDOCX',
'tableAlign' => 'center',
'columnWidths' => array(1000, 2500, 3000),
);
$docx->addTable($valuesTable, $paramsTable);
$docx->createDocx('example_addTable_2');
Regards.