-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
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
Multicolumn layout is not working. #2627
Labels
Comments
Can anyone please assist with this? Am I doing something wrong or does this just not work? |
For now I'm faking "columns" via a table. So first add a table and hide its borders, than for each "column", add a cell. Then append whatever you want to that cell. E.g. $invisibleTableStyle = [
// how to get 100% widht? 50*50 is apparently 50% wide
// 'width' => 50 * 100, 'unit' => 'pct',
'borderSize' => 5, 'borderColor' => '00FFFF',
'cellSpacing' => 5, 'cellMargin' => 80,
'alignment' => \PhpOffice\PhpWord\SimpleType\JcTable::START,
];
$invisibleTableRowStyle = [];
$phpWord->addTableStyle('InvisibleTable', $invisibleTableStyle, $invisibleTableRowStyle);
$table = $phpWord->addTable('InvisibleTable');
$table->addRow();
foreach ($YOUR_COLUMS as $i => $subSection) {
$cell = $table->addCell(null, null);
$cell->addText( "COLUMN {$i}");
// $cell->addChart();
// etc.
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug and add attachments
Adding a
section
with multiple columns has no effect on the resulting .docx.E.g.
I tried removing "Compatibility Mode" via
$phpWord->getCompatibility()->setOoxmlVersion(15);
to no effect.And running the Sample_05_Multicolumn.php example also doesn't work. Neither the docx, HTML or ODT files have multiple columns
Actual result from phpWord
Expected result
Expected behavior
See the screenshot. I expect the document to have more than one column.
Steps to reproduce
Exactly as per https://github.com/PHPOffice/PHPWord/blob/master/samples/Sample_05_Multicolumn.php
PHPWord version(s) where the bug happened
master
PHP version(s) where the bug happened
8.1
Priority
The text was updated successfully, but these errors were encountered: