I have a table with 3 columns. I'm trying to make the 3 columns the same size.
I used the following code as per docs. I get the table rendered but the column widths are
not equal. Is something wrong ?
//the column data
$image = new WordFragment($docx);
$options = array(
'src' => $tImg,
'imageAlign' => 'center',
'scaling' => 80,
'spacingTop' => 10,
'spacingBottom' => 0,
'spacingLeft' => 0,
'cellSpacing' => 15,
'spacingRight' => 0,
'textWrap' => 0,
);
$image->addImage($options);
$tblRows[] = array(array('colspan' => 3,'value' => $image));
$tlabel = new WordFragment($docx);
$tlabel->addText(array(array('text' => 'Stat 1 ','bold' => true,'fontSize' => 10)));
$ilabel = new WordFragment($docx);
$ilabel->addText(array(array('text' => 'Stat 2 ','bold' => true,'fontSize' => 10)));
$mlabel = new WordFragment($docx);
$mlabel->addText(array(array('text' => 'Stat3','bold' => true,'fontSize' => 10)));
$tblRows[] = array($tlabel,$ilabel,$mlabel);
//table config
$tblConfig = array(
'border' => 'single',
'cellMargin' => 125,
'tableStyle' => 'TableGridPHPDOCX',
'tableAlign' => 'center',
'columnWidths' => array(1000,1000,1000),
'textProperties' => array('font' => 'Arial', 'fontSize' => 10),
);
$docx->addTable($tblRows, $tblConfig);