Hello,
In a table, vertical align is a cell style, but horizontal align is a paragraph style. You can set a custom horizontal align creating a WordFragment and adding it to the table.
For example:
$docx = new CreateDocx();
$textFragmentLeft = new WordFragment($docx, 'document');
$textFragmentLeft->addText('Default alignment');
$textFragmentCenter = new WordFragment($docx, 'document');
$textFragmentCenter->addText('Center alignment', ['textAlign' => 'center']);
$textFragmentRight = new WordFragment($docx, 'document');
$textFragmentRight->addText('Right alignment', ['textAlign' => 'right']);
$valuesTable = array(
array(
$textFragmentLeft,
$textFragmentCenter,
$textFragmentRight,
),
array(
'Other cell 1',
'Other cell 2',
'Other cell 3',
),
);
$docx->addTable($valuesTable);
$docx->createDocx('output');
You can also apply other styles (such as bold, font size...) to the WordFragments and also add more than one content to the same WordFragment if needed (https://www.phpdocx.com/documentation/practical/wordfragments-and-wordml).
In the package you can find a more complex sample that creates a table with WordFragments in the following path: examples/Contents/addTable/sample_4.php
Regards.