我正在为 laravel 使用 PhpOffice(PhpWord) 插件。有必要为文档制作这样的标题。我认为你可以这样做:
$styleTable = array('borderSize' => 6, 'borderColor' => '999999');
$phpWord->addTableStyle('Colspan Rowspan', $styleTable);
$table = $section->addTable('Colspan Rowspan');
$row = $table->addRow();
$row->addCell(null, array('vMerge' => 'restart'))->addText('A');
$row->addCell(null)->addText('B');
$row->addCell()->addText('1');
$row = $table->addRow();
$row->addCell(null, array('vMerge' => 'continue'));
$row->addCell(null, array('vMerge' => 'continue', 'gridSpan' => 2));
$row->addCell()->addText('2');
$row = $table->addRow();
$row->addCell(null, array('vMerge' => 'continue'));
$row->addCell()->addText('C');
$row->addCell()->addText('D');
$row->addCell()->addText('3');
http://docs.mirocow.com/doku.php?id=php:docx_doc 这里详细描述了如何配置块
用表实现。