PHPWord
PHPWord copied to clipboard
Table ignores gridSpan
Hello, i try to make such table:

My code:
$phpWord = new PhpWord();
$section = $phpWord->addSection();
$headerStyle = ['size' => 16, 'bold' => true];
$boldStyle = ['bold' => true];
$tableStyle = ['borderSize' => 1];
$cellRestartSpan = ['vMerge' => 'restart', 'gridSpan' => 2];
$cellContinueSpan = ['vMerge' => 'continue', 'gridSpan' => 2];
$cellColSpan = ['gridSpan' => 2];
$section->addText('Наклейка', $headerStyle, ['alignment' => JcTable::CENTER]);
$table = $section->addTable($tableStyle);
$table->addRow();
$table->addCell(1000)->addText('Откуда: ', $boldStyle);
$table->addCell(4000)->addText('');
$table->addCell(5000, $cellRestartSpan);
$table->addRow();
$table->addCell(1000)->addText('От кого: ', $boldStyle);
$cell = $table->addCell(4000);
$cell->addText('');
$cell->addText($postForm->getSender()->translate()->getFullname());
$table->addCell(5000, $cellContinueSpan);
$table->addRow();
$table->addCell(5000, $cellColSpan);
$table->addCell(1000)->addText('Куда: ', $boldStyle);
$table->addCell(4000)->addText($postForm->getAddress());
$table->addRow();
$table->addCell(5000, $cellColSpan);
$table->addCell(1000)->addText('Кому: ', $boldStyle);
$table->addCell(4000)->addText($postForm->getFio());
But rows in down ignores gridSpan:

Please help)
I am having a similar issue.
In 2022, I also found this problem.