?
Solved

<PRE > in IE 6

Posted on 2003-03-18
8
Medium Priority
?
179 Views
Last Modified: 2012-06-22
I can't get IE 6.0.2600 to preserve the whitespace between <pre> elements. It also does not respect whitespace using CSS. What is the alternative?

Thanks,
bmh
0
Comment
Question by:bmh777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8162555
Need to see the code>

Cd&
0
 

Author Comment

by:bmh777
ID: 8163927
This works in NN 6.2.1.

CSS
p.text     {color:black; font-family:arial; font-weight:lighter; font-size:10pt; white-space:pre}

HTML
<p class="text">Title        First Name               Middle Name/Initial    Last Name               Title</p>
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 200 total points
ID: 8166838
Even though white-space:pre was supposed to be support in IE from 5.5 onward.  The truth is that it does not work, and never has for IE.  The only sloution is the directly apply the formatting with the pre tag:

<p><pre> Title         First Name        Middle Name/Initial         Last Name      Title</pre></p>

If IE6 now has a bug in the pre tag then I guess everone is rally stuck, because the only options left would be to use non-breaing spaces or use the xmp tag, which is obsolete and not support by all browsers.  I'm still using 5.5 because it is a better brower than 6, so I look at everything in 5.5 where pre still works.
 
Cd&
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:bmh777
ID: 8169017
<p><pre> Title         First Name        Middle Name/Initial         Last Name      Title</pre></p>

won't work in IE6, that's why I went to CSS. You said, "the only options left would be to use non-breaing spaces or use the xmp tag."  What is a non-breaing space? Did you mean non-bearing? If so, what's that? I find it hard to believe that IE 6 offers no way to preserve white space. There must be millions of users of IE 6 out there. MicroSoft has to be aware of the problem. Do you know of any patches(I'll check the MSDN web page)?

bmh
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8170133
Sorry for the typo  it should be non-breaking spaces

The notation &nbsp; will insert a space unconditionally.  soyou could do something like:

<p>Title &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; First Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  
Middle Name/Initial &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Last Name&nbsp; &nbsp; &nbsp;  Title </p>

That would insert the spacing but it is ugly and difficult to maintain.

Another possibility is
<p class="text">
<!--[if lt IE 6]><pre><![endif]-->Title      First Name        Middle Name/Initial           Last Name          Title
 <!--[if lt IE 6]></pre><![endif]--></p>
IE5 and 5.5 will see the pre tag, and other browsers will not see the code.

Cd&
0
 

Author Comment

by:bmh777
ID: 8172057
I'm sorry, upon further inspection IE 6 does support the <pre> element. I've been using my CSS for so long I forgot to check the use of <pre> directly in HTML.

Where can I find documentation on the using []'s inside of <!-- and --> as you did? I think I've seen that before, but I didn't pay attention to it.

Thanks for your help,
bmh
0
 

Author Comment

by:bmh777
ID: 8172072
[]'s should be [ ]'s (square brackets)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8173788
That little piece is IE only.  It is supposed to help with cross version compatibility problems.  I ran across it here:

http://www.blooberry.com/indexdot/html/tagpages/c/conditblock.htm

Glad I could help.  Thanks for the A. :^)

Cd&
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Now-a-days, indirectly, postal services have been replaced by email services. Yes, whenever we hear the word "email" a lot of people only think of gmail. Some people still think that email and gmail are one and the same thing :-). Let's see some …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question