Hello,
This is a simple example to add centered text:
<?php
require_once '../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$textFragment = new WordFragment($docx);
$text = array();
$text[] =
array(
'text' => 'Centered text',
'underline' => 'single'
);
$paragraphOptions = array(
'textAlign' => 'center',
);
$textFragment->addText($text, $paragraphOptions);
$valuesTable = array(
array(
$textFragment,
),
array(
'Other text',
),
array(
'Other text',
),
);
$docx->addTable($valuesTable);
$docx->createDocx('output');
Regards.