[thelist] CSS White-space

Nan Smith nansmith at heritageconcord.org
Thu Aug 15 15:28:00 CDT 2002


I had a situation like this, it was on a school district website. The
minutes to the school board meetings were going to become available on
the website, and instead of dealing with the issues you are talking
about, we converted the text to Adobe Acrobat documents. It saved a ton
of headaches.
Not sure this would work in your case, but I thought I would throw that
out. You could put the link to the pdf file in the database.
Nan

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of William Hutton
Sent: Thursday, August 15, 2002 1:40 PM
To: thelist at lists.evolt.org
Subject: [thelist] CSS White-space


I have a very large text string, varchar(4000), in a SQL database that
I'd like to display.  Here's the problem;

If I place it inside a <p> tag, I lose the text formatting in the string;
spaces, carriage returns, line-feeds, etc.

If I place it inside a <pre> tag, I get the test formatting, but I lose
the word-wrap.  :(

After doing some research, as best as I can tell, an in-line style sheet
for the <p> tag would fix my problem, but I can't seem to get it to work.
Here's the page I found;

   http://www.blooberry.com/indexdot/css/properties/text/whitespace.htm

And it seems that the following should accomplish what I need;

<p STYLE="white-space: -pre-wrap">foo</p>

However, even this simple test doesn't seem to work;

<p style="white-space: pre">
This should be preformatted text;

   But is it?
   Is it?!
</p>

If I change the <p> tags to <pre>, the text displays with the propper
formatting.  I wanted to see if ANY of the white-space style sheet
attributes worked.  I think these are supposed to be supported in HTML
4.0, and IE5.5+.  I'm using IE6.

Anyone have a suggestion?  Either to get this to work, or some other way
to accomplish my goal?

Thanks,
Will

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !




More information about the thelist mailing list