PHPOffice / PHPWord

A pure PHP library for reading and writing word processing documents
https://phpoffice.github.io/PHPWord/
Other
7.23k stars 2.69k forks source link

Can't add cellspacing/cellpadding or padding to Table with AddHtml #1701

Open danilocarva9 opened 5 years ago

danilocarva9 commented 5 years ago

Describe the Bug

Guys, I'm using AddHtml to render a table, but I can't render with cellspacing or cellpadding or even when I add "style='padding: 10px'". Is there a way to have a padding between ? thanks.

Steps to Reproduce

$Html .= '<table border="1" cellpadding="5" cellspacing="5">';
$Html .= '<thead>
                        <tr style="background-color: #AACCFF;">
                            <th style="padding: 15px;"><b>CPF/CNPJ</b></th>
                            <th style="padding: 15px;"><b>Investigado</b></th>
                            <th style="padding: 15px;"><b>Data Inicio</b></th>
                            <th style="padding: 15px;"><b>Data Final</b></th>
                        </tr></thead><tbody></table>';
0b10011 commented 5 years ago

Unfortunately, there's currently a very limited support for margins and no support for padding. I'm working on getting #1669 merged which is the groundwork for more improvements down the road, and I definitely noticed while working on that that HTML parsing is lacking. I have a few other things I need to work on as well, but after that PR is merged, I will hopefully eventually get to rewriting HTML parsing to add support for things like this.

SarahTrees commented 4 years ago

Bountysource? Yeah, I want that baked. Small incentive deposited: https://www.bountysource.com/issues/79186804-can-t-add-cellspacing-cellpadding-or-padding-to-table-with-addhtml

Progi1984 commented 1 month ago

@SarahTrees You Can now use @algora-io 👍