473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How do I preserve the text formatting with IE?

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?

May 31 '07 #1
1 1747
no*************@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; }

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?
Check the beginning of the string and if it doesn't have a \n then add one.

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: shoo | last post by:
Any one know how to do this? thank Write a simple text-formatting program that produces neatly printed output from input text containing embedded command lines that determine how to format the...
2
by: Blaine76 | last post by:
Hi All, This may seem like a stupid question but is there a way to keep text formatting when you add it to a database? Such as Paragraphs and line breaks? Any help greatly appreciated. Blaine
1
by: Pete from Boston | last post by:
I'm going through some "learning by doing" of javascript through trial and error, and admittedly have a lot to learn. But in taking various scripts and dissecting them, I still can't figure out if...
6
by: shoo | last post by:
Any one know how to do this? thank Write a simple text-formatting program that produces neatly printed output from input text containing embedded command lines that determine how to format the...
1
by: Chuck Bowling | last post by:
Up front, i'm not very good with serialization and i'm not quite sure what capabilities it has. I have an app that outputs a text file with this format: <root> \t <node1> \t\t text... \t...
2
by: al_johnson111 | last post by:
Apologies for the almost duplicate post but thought this was much clearer description of the issue than what I originally posted. I'm trying to do simple integration with a third-party web...
0
by: vijay mathews | last post by:
hi i am developing a chat application tool for a company i have a problem..... i have written codings for text formatting such as color, size etc in vb.net..... but when it is connected to a...
1
bartonc
by: bartonc | last post by:
Did you know that it's perfectly legal to defer text formatting until you have the value(s) available? Watch this: s = "%d apples plus %d apples equals %d apples." yours = 3 mine = 4 print s...
3
by: =?Utf-8?B?b24tbGluZSBqb3VybmFsIGVkaXRvcg==?= | last post by:
I can't seem to cut-and-paste text, with either .doc or .html formatting, into my .asp web-pages --all the formatting is lost. Is there some code that needs to be added to the page that will...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.