Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / May 2007



Tip: Looking for answers? Try searching our database.

How do I preserve the text formatting with IE?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
noagbodjivictor@gmail.com - 31 May 2007 19:45 GMT
I want to preserve how the text looks in the code. It's a <td>
element, so I styled it like this: td#textarea { white-space: pre; }

It's working in FF. But IE6 is getting rid of the first blank line of
my text. This line is necessary.

<td id="textarea"><-- the text does not start on this line
<-- the text starts here, on this line; so, there is a "\n" at the
beginning
</td>

Do you have any idea of how to fix that?
Randy Webb - 31 May 2007 22:08 GMT
noagbodjivictor@gmail.com said the following on 5/31/2007 2:45 PM:
> I want to preserve how the text looks in the code. It's a <td>
> element, so I styled it like this: td#textarea { white-space: pre; }
[quoted text clipped - 8 lines]
>
> Do you have any idea of how to fix that?

Check the beginning of the string and if it doesn't have a \n then add one.

Signature

Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.