-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
This is:
- a bug report
Expected Behavior
To properly generate the colspan and rowspan properties, when loading a docx document containing tables (with merged cells) and convert it to html
Current Behavior
The colspan and rowspan properties (loaded from tables in a docx ) are being ignored by the HTML Writer. I believe that by the other Writers too.
Failure Information
When a table like this is loaded,
<table>
<tbody><tr>
<td>
<p style="text-align: center; margin-top: 0; margin-bottom: 0;">A</p>
</td>
<td>
<p style="text-align: center; margin-top: 0; margin-bottom: 0;">B</p>
</td>
<td>
<p style="text-align: center; margin-top: 0; margin-bottom: 0;">C</p>
<p style="text-align: center; margin-top: 0; margin-bottom: 0;">R</p>
</td>
<td>
<p style="text-align: center; margin-top: 0; margin-bottom: 0;">D</p>
</td>
</tr>
<tr>
<td>
<p style="text-align: center; margin-top: 0; margin-bottom: 0;">Q</p>
</td>
<td>
<p> </p>
</td>
<td>
<p> </p>
</td>
</tr>
<tr>
<td>
<p style="text-align: center; margin-top: 0; margin-bottom: 0;">Z</p>
</td>
<td>
<p style="text-align: center; margin-top: 0; margin-bottom: 0;">E</p>
</td>
<td>
<p> </p>
</td>
</tr>
</tbody></table>
How to Reproduce
$template ='path/to/document.docx';
$phpWord = \PhpOffice\PhpWord\IOFactory::load($template);
$htmlWriter = new \PhpOffice\PhpWord\Writer\HTML($phpWord);
$htmlString = $htmlWriter->getContent();
print $htmlString;
Context
- PHP version: 7.2.0
- PHPWord version: 0.13.0
Metadata
Metadata
Assignees
Labels
No labels