Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table border shown in wkhtmltopdf

Tags:

wkhtmltopdf

I use WKHTMLTOPDF to generate a pdf. On my page, I have a table with no border. In the browser everything is fine. Example of table:

<table class="noborder" border="0">
    <tbody>
        <tr class="noborder">
            <th colspan="2" class="noborder">MyHeader</th>
         </tr>
     </tbody>
</table>

CSS: Noborder:

.noborder {
    border: 0px solid black;
}

But in the generated PDF there are the borders.

like image 441
Peter Avatar asked Sep 05 '25 03:09

Peter


1 Answers

I am having the exact same problem. In browser everything renders ok. But when I render in pdf, borders appear in all tables. I had to use tables because wkhtml and pdfkit were not able to interpret div class row and div class col; consequently text never appeared as desired in the pdf.

However this seems to work:

td {
    border-style : hidden!important;
   }

This was reported: Removing unwanted table cell borders with CSS

like image 66
LeninGF Avatar answered Sep 07 '25 22:09

LeninGF