This is an archived forum post. The information may be outdated. Contact us if you have any questions.

page-break-inside: avoid;

safetymatters wrote on 2014-06-10:
It seems that page-break-inside: avoid; does not work for our tables and/or rows.
I can't get it to work for td's that have text areas in them either... basically, page-break-inside: avoid; is not playing nice for us.
I've searched these forums looking for some tips and tricks.
Basically, if any part of our table would print on the next page, i need to whole table to start on the next page.
Am I going about it the wrong way?
Is there a different way to stop elements from breaking across the page?
Any thoughts, ideas, or suggestions are greatly appreciated.
support wrote on 2014-06-11:
Hello

>> Basically, if any part of our table would print on the next page, i need to whole table to start on the next page.
Unfortunately, this is not possible with Pdfcrowd.

>> Is there a different way to stop elements from breaking across the page?
The CSS rule below should prevent page breaks inside table cells. You can use page-break-inside:avoid on block level elements like <img> or <div> as well.
td, th { page-break-inside: avoid; }

However, it is possible that this will not work in some cases. If you have an example where page-break-inside does not work, please post it here and we will look at what can be done about it.
safetymatters wrote on 2014-06-13:
Yeah, that does it for some of the td's. Not exactly what we're going for.
I think we'll be redoing some of our pages to use divs instead. But tables are easy for things like invoices, which are what we're trying to make in this case. Are there any html/css code examples floating around, some templates for different pages... like an invoice?
It'd be great to not start from scratch.
Thanks.
support wrote on 2014-06-16:
Hello,

I don't have a template but a table instead of divs should indeed work better in this case. If possible, avoid floating elements as this is the primary source of problems with page breaks.