Tim Visher
Tim Visher

Reputation: 12854

IE 8 duplicates first element when printing

I'm observing the following behavior when I use IE 8 to print a page from the webapp I'm working on.

element n is an html element. The page is styled using a media=print sheet.

In ASCII:

+-----------------+
+ element 1       +
+ element 2       +
+ *page-break*    +
+ element 3       +
+ element 4       +
+-----------------+

prints

+-----------------+
+ element 1       +
+ element 2       +
+-----------------+
+-----------------+
+ element 3       +
+ element 4       +
+-----------------+

in Safari, Chrome, and Firefox.

IE prints:

+-----------------+
+ element 1       +
+-----------------+
+-----------------+
+ element 1       +
+ element 2       +
+-----------------+
+-----------------+
+ element 3       +
+ element 4       +
+-----------------+

The duplication of element 1 has been documented so far as working when element 1 is an img or an h1 tag. I have no idea if it works in further situations.

Quick Googling didn't reveal anything of note.

Is this something others have encountered before? If not, I can post my code someplace. Unfortunately, my work does a pretty good job of blocking anyplace that I could publish it. The code that is exhibiting the behavior when the first element is an img can be seen at Pastie. It's different CSS when the first element is an h1 but the same concepts (I know it should be a single style… working on it). If we can solve it for these styles I should be able to solve it for the others.

Thank in advance!

Upvotes: 0

Views: 275

Answers (1)

codephobia
codephobia

Reputation: 1590

I had this same problem happening to me. Not sure if this applies in your case, but I removed a <thead></thead> tag from the table and it stopped repeating that element. Just wanted to share as it was impossible to find an answer online anywhere.

Upvotes: 1

Related Questions