PHPOffice/PHPWord — pull request #21 by kaystrobach (2013-04-04 13:54:59+00:00)
Title: [FEATURE] add rowspan and colspan to cells :D

Based on http://tegarrputra.wordpress.com/2011/11/02/merging-cells-in-msword-2007-table-using-phpword/

$styleCell=array('gridSpan' => 2);
$table->addCell(100,$styleCell)->addText('Colspan');

//first cell expected to be rowspanned
$table->addCell(100,array('vMerge' => 'restart'))->addText('1');
//ordinary cell
$table->addCell(100)->addText('2');
$table->addRow();
//merge cell to cell above(first cell)
//this technique make empty cell which merged with above cell that //hold 'restart' style
$table->addCell(100,array('vMerge' => 'fusion'));
//ordinary cell
$table->addCell(100)->addText('3');