Wicked pdf rendering the last row across two pages

前端 未结 2 1205
野的像风
野的像风 2021-02-06 17:38

I am using wicked_pdf to generate pdfs. The problem i am facing is that, sometimes it displays the last row in the page across two pages. Is there a way to tell wicked_pdf to re

2条回答
  •  无人及你
    2021-02-06 18:27

    Since WickedPDF isn't actually creating a table (just rendering one from the html/css) there aren't many options available - you can try using page-break-inside: avoid; in your css, you may also need to manually break down the sizes of the tables so that the effect of avoiding page breaks isn't too severe.

    css:

    table, tr, td, th, tbody, thead, tfoot {
        page-break-inside: avoid;
    }
    

    That should get you started, at least.

    Edit: Here is another question on this subject with some further info: How to avoid page break inside table row for wkhtmltopdf

提交回复
热议问题