473,889 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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 <tdtag. 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
Sep 29 '06 #1
8 1577
"Santos L Halper" <js@js.comwrote :
>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
Sep 29 '06 #2
On Fri, 29 Sep 2006 12:17:02 -0400, "Santos L Halper" <js@js.comwrote :
>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/
Sep 29 '06 #3
Santos L Halper wrote:
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?
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 <tdtag. 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.
Sep 29 '06 #4
Stephen Poley wrote:
On Fri, 29 Sep 2006 12:17:02 -0400, "Santos L Halper" <js@js.comwrote :
>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?
Sep 29 '06 #5
On Fri, 29 Sep 2006 12:46:22 -0400, Harlan Messinger
<hm************ *******@comcast .netwrote:
>Stephen Poley wrote:
>On Fri, 29 Sep 2006 12:17:02 -0400, "Santos L Halper" <js@js.comwrote :
>>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/
Sep 29 '06 #6
Stephen Poley wrote:
On Fri, 29 Sep 2006 12:46:22 -0400, Harlan Messinger
<hm************ *******@comcast .netwrote:
>Stephen Poley wrote:
>>On Fri, 29 Sep 2006 12:17:02 -0400, "Santos L Halper" <js@js.comwrote :

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.
Sep 29 '06 #7
On 2006-09-29, Santos L Halper <js@js.comwrote :
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 <tdtag. 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 ;
Sep 29 '06 #8
Santos L Halper wrote:
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
Sep 30 '06 #9

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

Similar topics

0
521
by: Gary Stollman | last post by:
My Father is a Clone//ETs plotting to overthrow the human race! On August 19, 1987 a gun-carrying Gary Stollman entered the studio of Los Angeles's KNBC television, crashing consumer reporter David Horowitz's live newscast. Stollman handed Horowitz a written statement and ordered him to read it while holding a gun on him. Unbeknownst to Stollman, KNBC immediately switched to a commercial, not permitting the statement to be transmitted. ...
1
566
by: omlet v4 | last post by:
Dear DBA, You are cordially invited to test and review our windows native and 100% pure Java Oracle 9i/8i Monitoring Application (OMLET). OMLET is the The Ultimate Visual Real Time Oracle Monitoring Tool. As the leading expert in your field, your opinion is highly valued and your feedback is ver appreciated. We would like to encourage you to distribute copies of OMLET to your associates and fellow DBAs. Omlet can be downloaded from:
5
2583
by: Derek Fountain | last post by:
I've been wading through the O'Reilly XSLT book. All seemed OK and sensible until I got to the "programming" bit - variables, loops, conditions and so on. Do people actually use this stuff for real work? I can the advantages of, say, being able to number pages or something, but surely to do any real work with this syntax is very difficult? The concepts don't really intimidate me. I've done a little functional-style programming, and...
9
3787
by: Dr John Stockton | last post by:
Assuming default set-ups and considering all reasonable browsers, whatever that may mean, what should an author expect that his readers in general will see (with visual browsers) for a page with body like <br><br> Abc <font size=+1> Abc <font size=+1> Abc <font size=+1> Abc <font size=+1> Abc <font size=+1>
10
1704
by: HK | last post by:
With VB.NET 2005, and a Windows Form, running on a dual CPU box, I need to take a recordset (e.g. 100,000 records) and spawn a thread to handle an internet XML transaction routine for each of the records. This is a nice use of threading because those internet requests are going against 3rd party servers that often have 1 second latency problems and so handling them with multiple threads is the fastest way to get through all the records in...
23
2570
by: vinod.bhavnani | last post by:
Hello all, I need desperate help Here is the problem: My problem today is with multidimensional arrays. Lets say i have an array A this is a 4 dimensional static array.
10
3101
by: Martin Hughes | last post by:
Hi guys, I was wondering if anyone could give me some advice. I am looking to develop an ASP.NET application that will enable several workstations to access real time telemetry data received from a vehicle on a track. The data flow would be as follows: |-- Workstation 1
0
1535
by: onegative | last post by:
G'day Y'all, I was hoping to get some expert feedback on a proposal I am considering regarding a new internal application to help fill some gaps in our IT department. I have some configuration data that would work well (very well in fact) defined as XML documents and I want to enrich that data with additional User defined information (child and/or attribute) using an XML application. Document specifics 1. Document size 150k - 300k...
0
9961
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11187
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10784
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5825
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4642
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4248
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3252
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.