473,320 Members | 2,088 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,320 software developers and data experts.

How to display non-HTML line breaks

G'day everyone

I'm trying to find out if there is a way (perhaps using CSS) to let
this code:

<table><tr><td>One
Two
Three</td></tr></table>

display the same as if the code would have been:

<table><tr><td>One<br>
Two<br>
Three</td></tr></table>

Of course, once I figure out how to do this, I still have to see if my
wysiwig HTML viewer can display it :-) because my wysiwig HTML viewer
is MS Word and/or OOo Writer. The reason is that I'm trying to use
HTML as an intermediary format to convert CSV to a word processing
format. But let me worry about that... it would be great if any of
you could just help me with the problem described above.

Thanks in advance
Samuel (aka leuce) ltns
Sep 3 '08 #1
19 2311
On 2008-09-03, Samuel Murray <le***@absamail.co.zawrote:
G'day everyone

I'm trying to find out if there is a way (perhaps using CSS) to let
this code:

<table><tr><td>One
Two
Three</td></tr></table>

display the same as if the code would have been:

<table><tr><td>One<br>
Two<br>
Three</td></tr></table>
td { white-space: pre-wrap }

or just white-space: pre (not all browsers support all the more exotic
flavours of white-space).
Sep 3 '08 #2
Samuel Murray wrote:
I'm trying to find out if there is a way (perhaps using CSS) to let
this code:

<table><tr><td>One
Two
Three</td></tr></table>

display the same as if the code would have been:

<table><tr><td>One<br>
Two<br>
Three</td></tr></table>

Of course, once I figure out how to do this, I still have to see if my
wysiwig HTML viewer can display it :-) because my wysiwig HTML viewer
is MS Word and/or OOo Writer. The reason is that I'm trying to use
HTML as an intermediary format to convert CSV to a word processing
format. But let me worry about that... it would be great if any of
you could just help me with the problem described above.
<table><tr><td><pre>One
Two
Three
1
2
3</pre></td></tr></table>

--
Nico

Sep 3 '08 #3
On Sep 3, 9:06*am, Ben C <spams...@spam.eggswrote:
On 2008-09-03, Samuel Murray <le...@absamail.co.zawrote:
I'm trying to find out if there is a way (perhaps using CSS) to let
this code:
td { white-space: pre-wrap }

or just white-space: pre (not all browsers support all the more exotic
flavours of white-space).
Thanks, this really helps.

Incidently, MS Word XP understands pre but not pre-wrap. OOo Writer
2.4 does not understand either of them.

Samuel (leuce)
Sep 3 '08 #4
Samuel Murray wrote:
G'day everyone

I'm trying to find out if there is a way (perhaps using CSS) to let
this code:

<table><tr><td>One
Two
Three</td></tr></table>

display the same as if the code would have been:

<table><tr><td>One<br>
Two<br>
Three</td></tr></table>

Of course, once I figure out how to do this, I still have to see if my
wysiwig HTML viewer can display it :-) because my wysiwig HTML viewer
is MS Word and/or OOo Writer. The reason is that I'm trying to use
HTML as an intermediary format to convert CSV to a word processing
format. But let me worry about that... it would be great if any of
you could just help me with the problem described above.
I'm confused and curious. Are you only using Word to view HTML or are
you using it to edit/write HTML as well? If the latter, that's just a
terrible idea. I don't know about Open Office but Word generates
hideous HTML.

As for CSV conversion, what's the problem? I can open a .csv file in
Word 2000 directly: It's plain text. Highlight the csv data, click
Table, Convert, Text to Table. Voila.

--
Ed Mullen
http://edmullen.net
A conscience is what hurts when all your other parts feel so good.
Sep 3 '08 #5
Neredbojias wrote:
On 02 Sep 2008, Samuel Murray <le***@absamail.co.zawrote:
>I'm trying to find out if there is a way (perhaps using CSS) to let
this code:

<table><tr><td>One
Two
Three</td></tr></table>

display the same as if the code would have been:

<table><tr><td>One<br>
Two<br>
Three</td></tr></table>

Look into the html <preattribute.
<PREisn't an attribute; it's an element.

A <PREblock inside the <TDis not the same as inserting <BR>
elements. Some elements which may be children of <TDmay not be
children of <PRE>. User agents may, and often do, apply formatting
rules to text within a <PREblock that they don't apply (under the
default styles) to text within <TD>, such as using a monospaced typeface.

In short, this suggestion doesn't do what the OP asked for. Whether it
does what the OP *wants* is another question; and the OP might have
some success using <PREplus additional styling to render the text in
a more appropriate manner. (That assumes he doesn't need any of the
elements that <PREexcludes, such as <IMG>, inline in his <TD>s.)

If Ben's suggestion of "white-space: pre-wrap" won't work, for
example, something like the following might provide the basic feature
with better styling under capable user agents and graceful degredation
under others:

td pre {
font-family: inherit;
white-space: pre-line;
}

<table>
<tr><td><pre>
One
Two
Three
</pre></td></tr>
</table>

"pre-line" seems to me closer to the OP's original request than Ben's
suggestion of "pre-wrap", since the former collapses whitespace.

Obviously the font styling might have to be changed, depending on how
<TDis styled. "font-family: inherit" works with FF2, but not with
IE7, so "font-family: serif" (or whatever) might be a better choice.

Unfortunately, none of the UAs I tried (FF2, IE7, oOO Writer 2.4)
appear to actually support "white-space: pre-line", so to get this to
render the way I think the OP wants it, you'd have to get rid of the
extra whitespace inside the <PREblock.

But this combination does preserve the line breaks and it does degrade
gracefully; in particular, oOO Writer will preserve the line breaks,
which I gather the OP wanted. And the line breaks will be preserved
even if CSS is disabled or overridden, which is probably desirable.

--
Michael Wojcik
Micro Focus
Rhetoric & Writing, Michigan State University
Sep 3 '08 #6
On 2008-09-03, Michael Wojcik <mw*****@newsguy.comwrote:
[...]
"pre-line" seems to me closer to the OP's original request than Ben's
suggestion of "pre-wrap", since the former collapses whitespace.
Yes, you're right pre-line is better (or would be if more people
supported it).

Pre-line is the same as normal except that it doesn't collapse newlines,
which is exactly what the OP wants.
Sep 3 '08 #7

Michael Wojcik wrote:
>
In short, this suggestion doesn't do what the OP asked for. Whether it
does what the OP *wants* is another question;
It may actually be more a case of deciding on a solution without fully
defining the problem. We don't know the whole situation, just that the
OP has asked how to do these line breaks. It could be doing something
else altogether is a better solution.

--
Berg
Sep 3 '08 #8

Ed Mullen wrote:
Samuel Murray wrote:
>>
I'm trying to use
HTML as an intermediary format to convert CSV to a word processing
format. But let me worry about that...

I'm confused and curious.
Me, too.
As for CSV conversion, what's the problem? I can open a .csv file in
Word 2000 directly
Why the OP wants to use HTML for this is a bit baffling.

--
Berg
Sep 3 '08 #9
Bergamot wrote:
Ed Mullen wrote:
>Samuel Murray wrote:
>>I'm trying to use
HTML as an intermediary format to convert CSV to a word processing
format. But let me worry about that...
I'm confused and curious.

Me, too.
>As for CSV conversion, what's the problem? I can open a .csv file in
Word 2000 directly

Why the OP wants to use HTML for this is a bit baffling.
Well, I'm glad it isn't just me.

--
Ed Mullen
http://edmullen.net
Are there seeing eye humans for blind dogs?
Sep 3 '08 #10
In article <Xn*****************************@194.177.96.78>,
Neredbojias <ne*********@gmail.comwrote:
You've obviously put some thought into this, which is quite
laudible in some dimensions. However, if Jukka ever snuck into
dorayme's bedroom, you'd be the one result that wouldn't particularly
surprise me.
There is a double counterfactual here and you have almost everything
about both the antecedents and the consequents wrong. That, of course,
is not surprising with your mangled neanderthalic methods of reasoning.

First, I do not have a bedroom. I am not that sort of being.

Second if I did and your Finnish mate wandered in, it would only be
because he had finally hunted down a disgusting coward or he had been
cunningly lured there bu my own team that is out hunting him down.

One thing for sure is that Interplan (the inter-planetary police force)
would soon be investigating a murder case.

--
dorayme
Sep 4 '08 #11
Neredbojias wrote:
On 03 Sep 2008, Michael Wojcik <mw*****@newsguy.comwrote:
><PREisn't an attribute; it's an element.

Oh yeah? What's its atomic number?
It's one lower than that of postium.

And instant postium is an isotope.
Whoosh Prevention: http://jeffwerner.ca/2004/12/postum_coffee_s.html
--
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Need a new news feed? http://blinkynet.net/comp/newfeed.html

Sep 4 '08 #12
On 2008-09-04, Blinky the Shark wrote:
Neredbojias wrote:
>On 03 Sep 2008, Michael Wojcik <mw*****@newsguy.comwrote:
>><PREisn't an attribute; it's an element.

Oh yeah? What's its atomic number?

It's one lower than that of postium.
And much higher than top-postium!
And instant postium is an isotope.
That's when a standards organization drinks too much (does that
explain OOXML?).

--
Chris F.A. Johnson, webmaster <http://Woodbine-Gerrard.com>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Sep 4 '08 #13
Chris F.A. Johnson wrote:
On 2008-09-04, Blinky the Shark wrote:
>Neredbojias wrote:
>>On 03 Sep 2008, Michael Wojcik <mw*****@newsguy.comwrote:
<PREisn't an attribute; it's an element.

Oh yeah? What's its atomic number?

It's one lower than that of postium.

And much higher than top-postium!
>And instant postium is an isotope.

That's when a standards organization drinks too much (does that
explain OOXML?).
"I'm a doctor, Jim, not an organization watcher."
--
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Need a new news feed? http://blinkynet.net/comp/newfeed.html

Sep 4 '08 #14
Blinky the Shark <no*****@box.invalidwrites:
at 61 I'm young enough that I can stay awake without drugs."
Hell, I'm 39 and I can't do that...

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
Sep 4 '08 #15
Sherm Pendley wrote:
Blinky the Shark <no*****@box.invalidwrites:
>at 61 I'm young enough that I can stay awake without drugs."

Hell, I'm 39 and I can't do that...
That's a shame, Sherm.
--
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Need a new news feed? http://blinkynet.net/comp/newfeed.html

Sep 4 '08 #16
In comp.infosystems.www.authoring.stylesheets on Thu, 04 Sep 2008
11:55:39 -0700, Blinky the Shark <no*****@box.invalidwrote:
Sherm Pendley wrote:
>Blinky the Shark <no*****@box.invalidwrites:
>>at 61 I'm young enough that I can stay awake without drugs."

Hell, I'm 39 and I can't do that...

That's a shame, Sherm.
I'm 44 and I can't... I can't... Please remind me of what I was about
to tell you that I can't do, nurse.

--
PJR :-)
slrn newsreader (v0.9.9): http://slrn.sourceforge.net/
extra slrn documentation: http://slrn-doc.sourceforge.net/
newsgroup name validator: http://pjr.lasnobberia.net/usenet/validator
Sep 4 '08 #17
Peter J Ross wrote:
In comp.infosystems.www.authoring.stylesheets on Thu, 04 Sep 2008
11:55:39 -0700, Blinky the Shark <no*****@box.invalidwrote:
>Sherm Pendley wrote:
>>Blinky the Shark <no*****@box.invalidwrites:

at 61 I'm young enough that I can stay awake without drugs."

Hell, I'm 39 and I can't do that...

That's a shame, Sherm.

I'm 44 and I can't... I can't... Please remind me of what I was about
to tell you that I can't do, nurse.
Pee.
--
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Need a new news feed? http://blinkynet.net/comp/newfeed.html

Sep 4 '08 #18
Neredbojias wrote:
>
<sigh / You've obviously put some thought into this, which is quite
laudible in some dimensions. However, if Jukka ever snuck into
dorayme's bedroom, you'd be the one result that wouldn't particularly
surprise me.
I see September started in August this year.

--
Michael Wojcik
Micro Focus
Rhetoric & Writing, Michigan State University
Sep 4 '08 #19
In article <Xn*****************************@194.177.96.78>,
Neredbojias <ne*********@gmail.comwrote:
Hardly. I've got a Winchester 30-ought-six, 5000 brand new dorayme
targets, and there's certainly nothing wrong with my hand!
OK, send a hand then, if you think that will show up better in my lab
tests than a scoop of your brain.

(And btw, you must be a very poor shot if you need so many targets. I
expect that you are as crazily irrational and unfair with a gun as you
are with words.)

--
dorayme
Sep 5 '08 #20

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

Similar topics

4
by: SB | last post by:
Hi, I'd like to display some non-ascii characters in a DOS window. I'm getting the characters from Windows Character Map, such as the Spade (U+2660) and a few others. However, I can't get it to...
4
by: bissatch | last post by:
I am trying to use DIV tags and a class to hide the DIV and the HTML within. I will use JavScript to change it from hidden to visible but that will come later. Below is the code I am using ...
15
by: yxq | last post by:
Hi I want to detect user display type, LCD or CRT, how to do? Thanks
5
by: yma | last post by:
Hello, I tried to display a column in MS Access 2000 nwind.mdb using 3 data controls. But I got "It is already opened exclusively by another user, or you need permission to view its data." I...
13
by: Ennio-Sr | last post by:
Hi all! After a very long struggle I finally succeded in transferring my old *.dbf file and the relating *.dbt (alias memo fields) to a pg table. For the time being I put the memo field in a...
1
by: DavidADEW | last post by:
I am writing an application that displays furniture in a 3D model - in a wire frame. The furniture has straight and rounded edges (doesn't need any shading) - a kind of CAD application but for non...
3
by: c676228 | last post by:
Hi everyone, I have a piece of code in sales.aspx.vb like this: Protected WithEvents Message As System.Web.UI.WebControls.Label Try ... ChartImage.ImageUrl = "ChartGenerator.aspx?" + DataStr +...
1
by: sneeka2 | last post by:
Hi, I'm developing a portfolio site, which contains a bunch of thumbnails wrapped in links: <a href="..."><img ... /></a>. A window.onload script inserts an onclick property into the links which...
11
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I know I sound like a one-note Johnny on this but I'm still looking for a solution. I need to display characters coming in from a serial port or a socket. I also need to be able to type...
1
by: Wingot | last post by:
Hey, I have an application codenamed WingFlex. It has a number of aspects to it, but the prudent parts for this problem are all within the "Client" Schema. The Client schema has three tables...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.