When Internet Explorer encounters a tag with the style white-space:pre inside a table, it will only print the first line even though it renders properly in the browser.
Give the following html in a HTML 4.0 transitional document IE will display both lines of text in the browser, but when you print it will only show the first line.
Affected Browsers
4 years ago
IE print bug with white-space:pre
When Internet Explorer encounters a tag with the style white-space:pre inside a table, it will only print the first line even though it renders properly in the browser.
3 years, 10 months ago
Hi,
I have a similar problem.
I’m using
my lengthy content with space and new line characters
I see the entire content just fine with all the formatting and word wrap. When I try to print it on paper through IE6, the complete content does not get printed and the text gets truncated at some point. In my instance, about 1000 chars towards the end of my 3500 chars text got cut off upon printing. I’m not why this is happening….Is there a text size restriction with
3 years, 10 months ago
ok sorry about the above comment that you can ignore. I did not know my html code would be skipped, so I’m reposting my comment. To clarify, I’m using html PRE tag within a html table so I can retain the text format as was entered with space and new line characters.
The PRE tag in my html code includes inline style i.e. word-wrap:break-word, width:700px, overflow:auto and font-family:arial
I see the entire content just fine with all the formatting and word wrap. When I try to print it on paper through IE6, the complete content does not get printed and the text gets truncated at some point. In my instance, about 1000 chars towards the end of my 3500 chars text got cut off upon printing. I’m not why this is happening….Is there a text size restriction with PRE tag. Is there a workaround for this? Appreciate any help. Thanks.
3 years, 10 months ago
Actually, it seems to always display just one page of text and cuts off the rest of the text.
3 years, 10 months ago
I’m not sure if this is related, but it looks like IE 6, when printing, miscalculates the height of a box having white-space: pre. Webpage renders OK, but in print (and print preview) it looks like height of the “white-space: pre” box equals line height. Contents of the next box overlay the pre-box if the latter contains more than one line of content.
Workaround is to use pre-tag instead of white-space: pre. This is nasty and hairy, but I have not been able to figure out anything better.