Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

page-break-inside:avoid equivalent for Firefox and/or IE

I understand that the CSS page-break-inside:avoid instruction is supposed to prevent a page break within a div when an HTML document is printed. Through searching the internet, I have found that it is only supported by Opera and IE8. Is there a work around that allows me to prevent page breaks in Firefox (3.6) or IE versions less than 8?

like image 423
René Nyffenegger Avatar asked Aug 03 '10 22:08

René Nyffenegger


People also ask

How do I avoid a page-break inside?

The page-break-inside property sets whether a page-break should be avoided inside a specified element. Tip: The properties: page-break-before, page-break-after and page-break-inside help to define how a document should behave when printed. Note: You cannot use this property on absolutely positioned elements.

What is page-break After avoid?

always − A page break should be forced after this element's box. avoid − No page break should be placed after the element's box if at all possible. left − Force one or two page breaks after the element's box, such that the next page on which an element is printed will be a left-hand page.

How do I prevent page breaks within a table row?

If set display of tr as block or some thing else then it change the formatting of table and insert double border. Or it is possible to insert the table header on each page, where the table was splitted.

How do I prevent a page-break in a div?

Syntax: page-break-inside: auto; avoid: It avoids a page break inside the element.


1 Answers

Sorry, my answer is "not possible", although I'd love it if anyone can prove me wrong.

I've ran into the same problem lately, and after doing a little bit of research I decided to just go with

page-break-after: always;

after every several number of elements.

http://reference.sitepoint.com/css/page-break-inside

http://reference.sitepoint.com/css/page-break-after

like image 131
Scott Yang Avatar answered Oct 25 '22 13:10

Scott Yang