HighDots Forums  

pre element, flow text

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss pre element, flow text in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Roderik
 
Posts: n/a

Default pre element, flow text - 09-01-2004 , 08:54 PM






Hi,

When I use <pre> inside my <td> cells, the text won't flow to a new line
and the table gets to large in width. This will appear in Firefox this
way, Internet Explorer will wrap the lines, like I want, by default.
Any idea what I should define to make firefox wrap the text inside the pre?

<table><tr><td><pre>this is unwrapped in firefox</pre></td></tr>....<table>

regards,

Roderik
--
http://www.archytas.nl/
webdesign, internet applicaties, internetgestuurde elektronica

Reply With Quote
  #2  
Old   
Nik Coughin
 
Posts: n/a

Default Re: pre element, flow text - 09-01-2004 , 09:16 PM






Roderik wrote:
Quote:
Hi,

When I use <pre> inside my <td> cells, the text won't flow to a new
line and the table gets to large in width. This will appear in
Firefox this way, Internet Explorer will wrap the lines, like I want,
by default.
Any idea what I should define to make firefox wrap the text inside
the pre?

table><tr><td><pre>this is unwrapped in
firefox</pre></td></tr>....<table

regards,

Roderik
<pre> means "This text is preformatted, do not apply any formatting" --
which includes line breaks. Manually insert a line break in your code or
use <br>.




Reply With Quote
  #3  
Old   
Roderik
 
Posts: n/a

Default Re: pre element, flow text - 09-01-2004 , 09:19 PM



Nik Coughin wrote:

Quote:
Roderik wrote:

Hi,

When I use <pre> inside my <td> cells, the text won't flow to a new
line and the table gets to large in width. This will appear in
Firefox this way, Internet Explorer will wrap the lines, like I want,
by default.
Any idea what I should define to make firefox wrap the text inside
the pre?

table><tr><td><pre>this is unwrapped in
firefox</pre></td></tr>....<table

regards,

Roderik


pre> means "This text is preformatted, do not apply any formatting" --
which includes line breaks. Manually insert a line break in your code or
use <br>.


Okay, then I will remove the <pre> and look for a server side solution.

--
http://www.archytas.nl/
webdesign, internet applicaties, internetgestuurde elektronica


Reply With Quote
  #4  
Old   
Beauregard T. Shagnasty
 
Posts: n/a

Default Re: pre element, flow text - 09-01-2004 , 09:59 PM



Quoth the raven Roderik:

Quote:
When I use <pre> inside my <td> cells, the text won't flow to a new
line and the table gets to large in width. This will appear in
Firefox this way, Internet Explorer will wrap the lines, like I
want, by default. Any idea what I should define to make firefox
wrap the text inside the pre?

table><tr><td><pre>this is unwrapped in
firefox</pre></td></tr>....<table
If IE wraps a <pre> on your page, it is because IE is broken. In this
case, Firefox is correctly rendering your code. <pre> is not supposed
to wrap by itself.

--
-bts
-This space intentionally left blank.


Reply With Quote
  #5  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: pre element, flow text - 09-02-2004 , 12:25 AM



Roderik <mail (AT) roderik (DOT) net> wrote:

Quote:
When I use <pre> inside my <td> cells, the text won't flow to a new
line and the table gets to large in width. This will appear in
Firefox this way, Internet Explorer will wrap the lines, like I want,
by default.
Really? I don't see IE doing such things.

But you posted the same question to the css-discuss list. It is not
friendly to send one's question to several international fora without
mentioning what you are doing, for reasons quite similar to the reasons
why multiposting is harmful.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #6  
Old   
jmm-list-gn
 
Posts: n/a

Default Re: pre element, flow text - 09-02-2004 , 12:35 AM



Roderik wrote:
Quote:
pre> means "This text is preformatted, do not apply any formatting"
-- which includes line breaks. Manually insert a line break in your
code or use <br>.

Okay, then I will remove the <pre> and look for a server side solution.

It is easier to use <tt> or <code>.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)


Reply With Quote
  #7  
Old   
Neal
 
Posts: n/a

Default Re: pre element, flow text - 09-02-2004 , 01:05 AM



On Wed, 01 Sep 2004 22:35:58 -0700, jmm-list-gn
<jmm-list.AXSPAMGN (AT) sohnen-moe (DOT) com> wrote:

Quote:
Roderik wrote:

pre> means "This text is preformatted, do not apply any formatting"
-- which includes line breaks. Manually insert a line break in your
code or use <br>.

Okay, then I will remove the <pre> and look for a server side solution.

It is easier to use <tt> or <code>.

Without knowing what he's doing, that's not necessarily the case. As the
OP didn't volunteer that info, we're in the dark as to what would be
better.


Reply With Quote
  #8  
Old   
Lachlan Hunt
 
Posts: n/a

Default Re: pre element, flow text - 09-02-2004 , 03:00 AM



Roderik wrote:
Quote:
Hi,

When I use <pre> inside my <td> cells, the text won't flow to a new line
and the table gets to large in width. This will appear in Firefox this
way, Internet Explorer will wrap the lines, like I want, by default.
Any idea what I should define to make firefox wrap the text inside the pre?

table><tr><td><pre>this is unwrapped in firefox</pre></td></tr>....<table
If you are just using pre to get the monospace font, then just use CSS
and apply the style to the table cell.

td { font-family: monospace; }

But, then I would question your reason for using a table, instead of
a more semantic element. Without knowing what exactly the content
represents, this is the best advice I can give. Think about what the
content represents and then choose an appropriate element that best
matches and, if necessary, assign a class and/or id to describe what it
is. Then apply the monospace font and other styles with the stylesheet
as required.

You could also try:

pre { white-space: pre-wrap; }

But that is a CSS 2.1 value, and I haven't checked which browsers (if
any) support it yet, as CSS 2.1 is only a Candidate Recomendation.

--
Lachlan Hunt
http://www.lachy.id.au/

Please direct all spam to abuse (AT) 127 (DOT) 0.0.1
Thank you.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.