page breaks in chrome-pdf not appearing as expected!
-
I have a report which has a primary table with a number of <tbody> elements in. Ideally I don't want a page-break within one of those elements (if it will fit on a page), but I would like it to break if there's an avoidable page-break coming up (eg so I don't get the title of a group on one page and the data on the next)
I've got a sample here that shows the problem - https://playground.jsreport.net/w/anon/7Lplc_qe
I have found a work-around of sorts, using
block: inline-table
, but that screws up the formatting on the rest of the table and even maually over-riding the widths of elements using Javascript (https://stackoverflow.com/a/58950136/1569675) isn't getting me the column widths I want after the inline-table change.Any ideas if
break-inside: avoid
can be made to work?
-
i think this is an old problem when mixing table elements (like tbody) and
page-break-inside
, so far i did not found any good solution for this that does not break the layout of the header or other part of the tableif you find a solution, let us know, it will be helpful for other users
PD: here is a more detailed explanation of why this does not work, and the solution described there does not work today 😔
-
so, there is a Chromium bug about this - https://bugs.chromium.org/p/chromium/issues/detail?id=547972, but implementation seems blocked on development of LayoutNG - https://bugs.chromium.org/p/chromium/issues/detail?id=829028 - so not sure when we'll see the light at the end of the tunnel...
-
This is kind of a frustrating error, I also suffered this error on my chrome. I fixed this issue by follow some steps from here https://droidtheory.com/pdf-not-opening-in-chrome-fixed/ You can also try them, they worked for me