Skip to content

Table rendering issues when using Html::addHtml()  #1636

Open
@catalinbuletin

Description

@catalinbuletin

This is:

Expected Behavior

I expect that borders are shown and cell padding is added.

Current Behavior

No border and padding are shown

How to Reproduce

This is part of the HTML string i'm adding to the Html::addHtml method

<table style="width: 100%; padding: 5px; border: 1px solid #000000; border-collapse: collapse;" border="1" cellpadding="5">
<tbody>
<tr>
<td style="width: 33.3333%;">Abc</td>
<td style="width: 33.3333%;">Def</td>
<td style="width: 33.3333%;">Hij</td>
</tr>
<tr>
<td style="width: 33.3333%;">Klm</td>
<td style="width: 33.3333%;">Nop</td>
<td style="width: 33.3333%;">Qrs</td>
</tr>
<tr>
<td style="width: 33.3333%;">Stt</td>
<td style="width: 33.3333%;">Vvx</td>
<td style="width: 33.3333%;">Xyz</td>
</tr>
</tbody>
</table>

Strange thing with the border attribute that is set on the table:

IF border: 1px #000000 solid will add borders as expected
IF border: 1px solid #000000 - will NOT add borders at all

Context

  • PHP version: 7.2
  • PHPWord version: 0.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions