Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search Sign up Reseting focus

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

wkhtmltopdf / wkhtmltopdf Public archive

avoid row break for long tables #3195

nimish13 opened this issue Nov 9, 2016 · 16 comments

avoid row break for long tables #3195

nimish13 opened this issue Nov 9, 2016 · 16 comments

Comments

nimish13 commented Nov 9, 2016 •

I'm currently using wkhtmltopdf to generate large PDFs that includes a table which may be long enough to be shown on a single page. We were having issues getting rows to break properly at the end of each page.

I am following the below structure

html 
. . . . . . .

We have tried using thead < display: table-header-group; >tfoot < display: table-row-group; >tr < page-break-inside: avoid; >and also other solutions provided on internet
But none is effective till now

Please help me in overcoming this issue.
Thanks in advance.

screen shot 2016-11-10 at 11 12 28 am

Please find below the screenshot of the pdf

The text was updated successfully, but these errors were encountered:

PhilterPaper commented Nov 10, 2016

Ah yes, the problem of breaking in the middle of a line, as you show, has come up before. I don't recall there being any solution that worked for everyone. The problem is that the rendering engine is WebKit, and it's just not suitable for the purpose. It expects one continuous page of output, and doesn't work well when you need to split its output into pages.

Some users have had some success with page_break_inside: avoid for rows, to split the table at a row, but that doesn't seem to always work.

nimish13 commented Nov 10, 2016

@PhilterPaper Thanks for replying.
So there is no solution to this problem? Not even any hack?

nimish13 commented Nov 10, 2016

@ashkulz - Please provide a solution to this issue if any.

spacemudd commented Nov 11, 2016

fixed_

@PhilterPaper I spent right now 3 days scouring the internet for a solution until I saw yours. Holy crap. I almost gave up.

PhilterPaper commented Nov 11, 2016

@nimish13, sometimes people report success using CSS to prevent page breaks inside of rows, but you say you've already tried that. Are you using a reasonably up to date version of wkHTMLtoPDF? If you are, I have no idea of anything else you could try.

nimish13 commented Nov 13, 2016

@PhilterPaper Yes am using latest version of wkhtmltopdf i.e 12.3.3. Thanks for your time.

alloylab commented Nov 13, 2016

with an !important tag?

Also, what OS is wkhtmltopdf running on? Did you download it or compile it yourself? If you compiled it yourself are you using a patched QT version?

ashkulz commented Nov 18, 2016

This looks to be a duplicate of #2141, see comments on the issue. Unfortunately, you can either choose to have rows break in the middle (without tr page-break-inside: avoid) or lines break in the middle (with tr page-break-inside: avoid).