IE Printing Bug white-space:pre

posted February 13th 2006 at 2002 EST in All, CSS, IE

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.

example page

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.


<table border="0"><tr><td>
<p style="white-space:pre;">
line 1 of text
line 2 of text
</p>
</td></tr></table>
 

Affected Browsers

5 Responses

  1. #1 Bug Report
    2 years, 4 months 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.

  2. #2 sunrays
    2 years, 2 months ago

    Hi,

    I have a similar problem.

    I’m using

     tag as follows in my html page so i can print the entire content in the same format as was entered with space and new line charcaters.
    
    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

     tag. Is there a workaround for this? Appreciate any help. Thanks.

  3. #3 sunrays
    2 years, 2 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.

  4. #4 sunrays
    2 years, 2 months ago

    Actually, it seems to always display just one page of text and cuts off the rest of the text.

  5. #5 Tero Tilus
    2 years, 1 month 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.

Leave a comment