We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to do here so:
$phpWord = new \PhpOffice\PhpWord\PhpWord(); $section = $phpWord->addSection( [ 'orientation' => 'landscape', 'marginTop' => 600, 'marginLeft' => 600, 'marginRight' => 600, 'marginBottom' => 600, ] ); $tableStyle = [ 'width' => 100, 'borderSize' => 6, 'alignment' => \PhpOffice\PhpWord\SimpleType\JcTable::CENTER, ]; $phpWord->addTableStyle('myTable', $tableStyle); $table = $section->addTable('myTable'); $row = $table->addRow(); $row->addCell(4200, ['valign' => 'center', 'vMerge' => 'restart']) ->addText('A', null, ['align' => 'center']); $row->addCell(null, ['textDirection' => Cell::TEXT_DIR_BTLR, 'gridSpan' => 2, 'vMerge' => 'restart',]) ->addText('B', null, ['align' => 'center']); $row->addCell(null, ['textDirection' => Cell::TEXT_DIR_BTLR, 'gridSpan' => 4]) ->addText('1', null, ['align' => 'center']); $row = $table->addRow(); $row->addCell(null, ['vMerge' => 'continue']); $row->addCell(null, ['vMerge' => 'continue']); $row->addCell(null, ['vMerge' => 'continue']); $row->addCell(null, ['gridSpan' => 2])->addText('2'); $row->addCell(null, ['gridSpan' => 2]); $row = $table->addRow(); $row->addCell(null, ['vMerge' => 'continue']); $row->addCell()->addText('C'); $row->addCell()->addText('D'); $row->addCell()->addText('3'); $row->addCell(); $row->addCell(); $row->addCell();
Result
To fix: Missing gridspan in the second block:
gridspan
<w:tc> <w:tcPr> <w:tcW w:w="0" w:type="dxa"/> <!--here need gridSpan--> <w:vMerge/> </w:tcPr> <w:p w:rsidR="00907392" w:rsidRDefault="00907392"/> </w:tc>
The text was updated successfully, but these errors were encountered:
Fixed:
$row->addCell(null, ['vMerge' => 'continue', 'gridSpan' => 2]);
Sorry, something went wrong.
No branches or pull requests
I'm trying to do here so:

Result

To fix: Missing
gridspan
in the second block:The text was updated successfully, but these errors were encountered: