Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

<PRE > in IE 6

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
bmh777
Asked:
bmh777
  • 4
  • 4
1 Solution
 
COBOLdinosaurCommented:
Need to see the code>

Cd&
0
 
bmh777Author Commented:
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
 
COBOLdinosaurCommented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
bmh777Author Commented:
<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
 
COBOLdinosaurCommented:
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
 
bmh777Author Commented:
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
 
bmh777Author Commented:
[]'s should be [ ]'s (square brackets)
0
 
COBOLdinosaurCommented:
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now