views:

569

answers:

1

Hi

I have a php file with 's and the things in the div should stay on one page, for this possebillity i found this:

http://www.w3schools.com/css/pr_print_pagebi.asp

However like you can see its only compatible with opera and nothing more. I dont want to demand my users to use opera so I was wondering if there was a alternative to the "page-break-inside:avoid".

Thanks Matthy

+2  A: 

Support for print specific CSS is pretty crappy. Have a look at the CSS discuss Wiki for an extensive guide (it also has a link to a browser support compatibility table). I have had some success with page-break-before: always when I was playing around with this sort of thing a few weeks back - as long as your div is less than a page long you may be able to just force a page break before it?

robertc
I've had *some* success with that, too. You'll have a lot of issues with page breaks, though. I spent almost a day working on it, and I eventually had to just move on. We ultimately resorted to using blank divs with page-break-before and hoping things worked out ok...(cringe)
Jon Smock