2
votes

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.

1
Out of curiosity, does the pdf only show borders when you open it in the browser? When I open my PDF in Mac via the standard viewer, it displays correctly. It's only when I render within Chrome that I have this issue. It also displays as expected in Safari.Kenny Cason

1 Answers

2
votes

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