HighDots Forums  

guess i need a real css expert on this one....

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


Discuss guess i need a real css expert on this one.... in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Santos L Halper
 
Posts: n/a

Default guess i need a real css expert on this one.... - 09-29-2006 , 11:17 AM






i cant believe that im the only person that has ever run into this problem.
im using a very simple table to layout a page. the table has 3 columns, with
the middle column being where the data will be displayed.
the table is set at 500px wide, with each column being a width that adds up
to 500px. so far so simple.

the text that will display in the middle column is being pulled from a
database. i have no way of knowing how long, or what the text will look
like. it could be a single word, it could be a whole book. it might have
spaces, it might not. it could very well be a single line of 2000 characters
with no spaces and no line breaks.

when something like this happens, the column explodes and expands so the
data fits. obviously i cant have this. i also cant use server side code to
deal with this. i have tried everything i can possibly think of and the only
thing that "works" is "word-wrap: break-word;" on the <td> tag. this simply
wraps the text to the next line as soon as it hits the wall of the column.
but that ONLY works in IE. so am i to believe that what i need to do is
impossible? or that im the only person that has come across this?

if i HAVE to do it this way, what can i use to fix this problem?

here is an example of the problem: http://www.sixhouse.net/wrap.html

someone please suggest a way to deal with this



Reply With Quote
  #2  
Old   
Spartanicus
 
Posts: n/a

Default Re: guess i need a real css expert on this one.... - 09-29-2006 , 11:24 AM






"Santos L Halper" <js (AT) js (DOT) com> wrote:

Quote:
here is an example of the problem: http://www.sixhouse.net/wrap.html
Please do not multi post, it won't generate more answers, more likely
the opposite.

--
Spartanicus


Reply With Quote
  #3  
Old   
Stephen Poley
 
Posts: n/a

Default Re: guess i need a real css expert on this one.... - 09-29-2006 , 11:38 AM



On Fri, 29 Sep 2006 12:17:02 -0400, "Santos L Halper" <js (AT) js (DOT) com> wrote:

Quote:
the text that will display in the middle column is being pulled from a
database. i have no way of knowing how long, or what the text will look
like. it could be a single word, it could be a whole book. it might have
spaces, it might not. it could very well be a single line of 2000 characters
with no spaces and no line breaks.

when something like this happens, the column explodes and expands so the
data fits. obviously i cant have this. i also cant use server side code to
deal with this.
If you are pulling unknown characters out of a database you need
server-side code to handle any problems that result. *That* is your
problem - fix it. No CSS expert can help because it's a content problem,
not a presentation problem.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/


Reply With Quote
  #4  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: guess i need a real css expert on this one.... - 09-29-2006 , 11:44 AM



Santos L Halper wrote:
Quote:
i cant believe that im the only person that has ever run into this problem.
im using a very simple table to layout a page. the table has 3 columns, with
the middle column being where the data will be displayed.
the table is set at 500px wide, with each column being a width that adds up
to 500px. so far so simple.

the text that will display in the middle column is being pulled from a
database. i have no way of knowing how long, or what the text will look
like. it could be a single word, it could be a whole book. it might have
spaces, it might not. it could very well be a single line of 2000 characters
with no spaces and no line breaks.
Is a table the most effective way to display data when the rows can span
dozens of pages/screens?

Quote:
when something like this happens, the column explodes and expands so the
data fits. obviously i cant have this. i also cant use server side code to
deal with this. i have tried everything i can possibly think of and the only
thing that "works" is "word-wrap: break-word;" on the <td> tag. this simply
wraps the text to the next line as soon as it hits the wall of the column.
but that ONLY works in IE. so am i to believe that what i need to do is
impossible? or that im the only person that has come across this?
CSS provides a max-width property, but it isn't implemented in IE or, at
least for table cells or columns, in Firefox.


Reply With Quote
  #5  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: guess i need a real css expert on this one.... - 09-29-2006 , 11:46 AM



Stephen Poley wrote:
Quote:
On Fri, 29 Sep 2006 12:17:02 -0400, "Santos L Halper" <js (AT) js (DOT) com> wrote:

the text that will display in the middle column is being pulled from a
database. i have no way of knowing how long, or what the text will look
like. it could be a single word, it could be a whole book. it might have
spaces, it might not. it could very well be a single line of 2000 characters
with no spaces and no line breaks.

when something like this happens, the column explodes and expands so the
data fits. obviously i cant have this. i also cant use server side code to
deal with this.

If you are pulling unknown characters out of a database you need
server-side code to handle any problems that result. *That* is your
problem - fix it. No CSS expert can help because it's a content problem,
not a presentation problem.
Well--if max-width were implemented, that would solve the problem, no?


Reply With Quote
  #6  
Old   
Stephen Poley
 
Posts: n/a

Default Re: guess i need a real css expert on this one.... - 09-29-2006 , 01:16 PM



On Fri, 29 Sep 2006 12:46:22 -0400, Harlan Messinger
<hmessinger.removethis (AT) comcast (DOT) net> wrote:

Quote:
Stephen Poley wrote:
On Fri, 29 Sep 2006 12:17:02 -0400, "Santos L Halper" <js (AT) js (DOT) com> wrote:

the text that will display in the middle column is being pulled from a
database. i have no way of knowing how long, or what the text will look
like. it could be a single word, it could be a whole book. it might have
spaces, it might not. it could very well be a single line of 2000 characters
with no spaces and no line breaks.

when something like this happens, the column explodes and expands so the
data fits. obviously i cant have this. i also cant use server side code to
deal with this.

If you are pulling unknown characters out of a database you need
server-side code to handle any problems that result. *That* is your
problem - fix it. No CSS expert can help because it's a content problem,
not a presentation problem.

Well--if max-width were implemented, that would solve the problem, no?
No, for two reasons.

1) http://www.w3.org/TR/REC-CSS2/visude...min-max-widths

"Applies to: all elements except non-replaced inline elements and table
elements"

2) If it did apply to table elements, the reader wouldn't be able to see
the remaining content. If it is "a single line of 2000 characters
with no spaces and no line breaks" then it needs to be broken
appropriately (or replaced by something else) by a piece of code that
specifically handles that type of content (whatever it may be).

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/


Reply With Quote
  #7  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: guess i need a real css expert on this one.... - 09-29-2006 , 01:50 PM



Stephen Poley wrote:
Quote:
On Fri, 29 Sep 2006 12:46:22 -0400, Harlan Messinger
hmessinger.removethis (AT) comcast (DOT) net> wrote:

Stephen Poley wrote:
On Fri, 29 Sep 2006 12:17:02 -0400, "Santos L Halper" <js (AT) js (DOT) com> wrote:

the text that will display in the middle column is being pulled from a
database. i have no way of knowing how long, or what the text will look
like. it could be a single word, it could be a whole book. it might have
spaces, it might not. it could very well be a single line of 2000 characters
with no spaces and no line breaks.

when something like this happens, the column explodes and expands so the
data fits. obviously i cant have this. i also cant use server side code to
deal with this.

If you are pulling unknown characters out of a database you need
server-side code to handle any problems that result. *That* is your
problem - fix it. No CSS expert can help because it's a content problem,
not a presentation problem.

Well--if max-width were implemented, that would solve the problem, no?

No, for two reasons.

1) http://www.w3.org/TR/REC-CSS2/visude...min-max-widths

"Applies to: all elements except non-replaced inline elements and table
elements"

2) If it did apply to table elements, the reader wouldn't be able to see
the remaining content. If it is "a single line of 2000 characters
with no spaces and no line breaks" then it needs to be broken
appropriately (or replaced by something else) by a piece of code that
specifically handles that type of content (whatever it may be).
OK. Well, then, they *could* allow in-word breaks in that case. No
reason not to make it an option. It may be ugly, but say the situation
is that text that normally wouldn't exceed the intended width of a
table's columns does so because the user's visual acuity is poor and he
has jacked up the font size way high. I can see why it might be easier
for him to make use of the table if the overflow were handled by
breaking the text within words rather than by imposing excessive
horizontal scrolling.


Reply With Quote
  #8  
Old   
Ben C
 
Posts: n/a

Default Re: guess i need a real css expert on this one.... - 09-29-2006 , 02:12 PM



On 2006-09-29, Santos L Halper <js (AT) js (DOT) com> wrote:
Quote:
i cant believe that im the only person that has ever run into this problem.
im using a very simple table to layout a page. the table has 3 columns, with
the middle column being where the data will be displayed.
the table is set at 500px wide, with each column being a width that adds up
to 500px. so far so simple.

the text that will display in the middle column is being pulled from a
database. i have no way of knowing how long, or what the text will look
like. it could be a single word, it could be a whole book. it might have
spaces, it might not. it could very well be a single line of 2000 characters
with no spaces and no line breaks.

when something like this happens, the column explodes and expands so the
data fits. obviously i cant have this.
i also cant use server side code to
deal with this. i have tried everything i can possibly think of and the only
thing that "works" is "word-wrap: break-word;" on the <td> tag. this simply
wraps the text to the next line as soon as it hits the wall of the column.
but that ONLY works in IE. so am i to believe that what i need to do is
impossible? or that im the only person that has come across this?

if i HAVE to do it this way, what can i use to fix this problem?
word-wrap: break-word is not standard. There is no way in standard CSS
2.1 to force word breaks-- no matter what widths, min-widths or
max-widths you set on any kind of box, if the longest unbreakable
sequence of characters is wider than the box, words will not be broken.
They will overflow in most cases (and you can control the behaviour with
the overflow property); in the case of table cells, the table cell will
grow and will never be overflowed.

All this makes sense because most of the time you don't want to break
words. Unless you do proper hyphenation, but deciding where to put the
hyphens gets quite complex.

One way you can get the result you want is to insert ​ (which is
the "zero-width space character") after every character in your source.
You can do this on the server or with JavaScript on the client side.

i.e. write your text l&8203;i&8203;k&8203;e&8203;
t&8203;h&8203;i&8203;s&8203;


Reply With Quote
  #9  
Old   
boclair
 
Posts: n/a

Default Re: guess i need a real css expert on this one.... - 09-29-2006 , 08:52 PM



Santos L Halper wrote:
Quote:
i cant believe that im the only person that has ever run into this problem.
im using a very simple table to layout a page. the table has 3 columns, with
the middle column being where the data will be displayed.
the table is set at 500px wide, with each column being a width that adds up
to 500px. so far so simple.

the text that will display in the middle column is being pulled from a
database. i have no way of knowing how long, or what the text will look
like. it could be a single word, it could be a whole book. it might have
spaces, it might not. it could very well be a single line of 2000 characters
with no spaces and no line breaks.

Split the string into set lengths on the server side.

Louise


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.