page break printing from IE not correct, Firefox ok

stee1hed
stee1hed used Ask the Experts™
on
I'm using the 'page-break-before: always' style setting to put a page break in the attached html file. There are 3 divs with tables in each that should print on their own page.

I only have the 'page-break-before' style on the 2nd and 3rd divs. If I put it on the first it prints a blank page first.

The first 2 divs always print on the same page but the 3rd (and 4th if added) prints on its own page.

Why do the first 2 divs print on the same page. This html works correctly in Firefox but not in my Internet Explorer 7.

I've been printing to the xps document writer to avoid wasting paper. I always press the print button that is a part of this page to print.
packing-slip.html.txt
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sr. System Analyst
Commented:
use this methoid
<style type="text/css">
@media print {
.pagestart {
  page-break-before: always;
  height: 1px;
}
}
</style>

<p class="pagestart"></p>
<div>...</div>

<p class="pagestart"></p>
<div>...</div>

<p class="pagestart"></p>
<div>...</div>

Open in new window

Author

Commented:
That looks like it worked. Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial