问题
I'm running wkhtmltopdf 0.12.2.1 (with patched qt) on my Ubuntu server and I can generate PDFs just fine. I've been using wkhtmltopdf to generate a table with several columns and sometimes one of those columns has a LOT of text.
My problem is this: I want my table rows to be able to span multiple pages without leaving white space before/after the row. WKHTMLTOPDF does some of this work for me, but it often leaves unwanted white space before the row if the row has lots of text because wkthmltopdf tries to keep the entire row on one page.
For example, the page might be half way full of the table when wkhtmltopdf encounters a row that would take up about 3/4 of the page for just that one row. Wkthmltopdf currently leaves the bottom half of the first page empty and starts the really long row on the next page. What I'd like to have happen is that that wkhtmltopdf starts the really long row on the first page, and then finishes the long row on the next page.
How can I do this?
I've thought about using divs and spans, but I need the table borders to still show up, so it seems like using a table is the best option. Any advice?
回答1:
After some thinking on this issue, it seems like the best thing to do would be to just change the format of the report to use divs and spans rather than use a table. I've gone ahead and done that and everything seems to work now.
来源:https://stackoverflow.com/questions/30927351/wkhtmltopdf-allow-page-break-in-table-row