Could you show me how I can compile the following table with the phpword library? I have dealt with the examples that it brings but I could not?
Awaiting your help, thank you very much.
This is my code
$fancyTableStyle = array('borderSize' => 6, 'borderColor' => '999999');
$cellRowSpan = array('vMerge' => 'restart', 'valign' => 'center', 'bgColor' => 'FFFF00');
$cellRowContinue = array('vMerge' => 'continue');
$cellVCentered = array('valign' => 'center');
$cellHCentered = array('alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER);
$cellColSpan = array('gridSpan' => 1, 'valign' => 'center');
$cellColSpan2 = array('gridSpan' => 2, 'valign' => 'center');
$table = $section->addTable('styleTable', $fancyTableStyle);
$table->addRow();
$cell1 = $table->addCell(2000, array('vMerge'=> 'restart'));
$textrun1 = $cell1->addTextRun();
$textrun1->addText('A');
$cell2 = $table->addCell(4500, array('gridSpan'=>2));
$textrun2 = $cell2->addTextRun($cellHCentered);
$textrun2->addText('B');
$table->addCell(null, $cellRowSpan);
$table->addCell(2000,$cellColSpan)->addText('C', null);
$table->addRow();
$table->addCell(null, $cellRowContinue);
$table->addCell(1500, $cellVCentered)->addText('B1', null, $cellHCentered);
$table->addCell(1500, $cellVCentered)->addText('B2', null, $cellHCentered);
$table->addCell(1500, $cellVCentered)->addText('B3', null, $cellHCentered);
$table->addCell(null, $cellRowContinue);
$table->addCell(2000, $cellVCentered)->addText('C1', null, $cellHCentered);
and what it shows me is the following