Preventing an element getting split over several pages

If you are trying to add a ‘total’ or a report footer and its getting split over the penultimate and final page, then just add this css to the element class:

page-break-inside: avoid;

Works a treat for me – I think its only for the @print containers but it successfully keeps my DIV in one piece on the last page, or if it won’t fit, on another page.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>