View Full Version : fixed size cell

01-08-2003, 06:03 PM
how to make the size of the table fixed, i mean when the data which will be filled into the cell has many charachters without new lines, so the table width will be enlarg as text width, so the design of the page will fail, how to limit anumber of charachters in each line to keep the table width?

my data get from my database and my table width is 75%

01-08-2003, 06:49 PM
That will not work in all & old browsers, but...

<td style="word-wrap: break-word;">

01-09-2003, 12:59 AM
it dosen't work, i am using IE6,and what the old method to make it work, just lilke this forum how they do it when i keep my finger on the zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzz button

01-09-2003, 04:06 PM
is it difficult?

01-09-2003, 04:27 PM
In the case of this forum, the text is probably parsed so that line breaks are automatically inserted every x characters, probably qualified slightly to prevent words being split.

01-10-2003, 04:27 AM
then it will done with server side script like asp , before inserting in DB i will insert breaks in the paragraph, and no solution for it by html or css,is it right??

this error found in this forum at this thread:


01-10-2003, 06:29 AM
So that I understand what it is you are asking... What you want is so that your table will stay the same width but allow for text to break naturally???

01-10-2003, 01:47 PM
yes exactly:)

01-10-2003, 07:49 PM
This is actually simple... Set a fixed width to your table data cell...

Say your table width is 75%


What you can do then is this

<TD WIDTH="15%">stuff</TD>
<TD WIDTH="85%">stuff</TD>

or you can use specific widths (pixels ofcourse)

<TD WIDTH="40">stuff</TD>
<TD WIDTH="60">stuff</TD>

So your Table itself, will take 75% of the page width, then your table objects (unless they are unbreakable) will take only the set size's they are allowed (more specifically by setting pixels as you are not allowing for percentages)

Now, when I said as long as the table object is unbreakable, I mean images or polled data... Really it depends on what you are placing into the table and how you are putting it there... Perhaps some code would be helpful...


01-10-2003, 09:39 PM
Originally posted by sage45
unless they are unbreakable

ehem.. the thread is about putting unbreakable objects in a cell without enlarging it ;)

01-10-2003, 11:20 PM
to sage,it dosen't work, i am talking about inserting text not images.

this my test page:

01-11-2003, 12:40 AM
Hi Ahmed,

As stated above, the only way I can think of to do this is to "manually" insert a line break every so many characters in your string...


01-11-2003, 02:39 AM
I see the problem.

break-word seems to work only with fixed cell widths, so
<td width=300 style="word-wrap: break-word;">
will break the words, but
<td width=75% style="word-wrap: break-word;">
not :(

01-11-2003, 03:58 PM
thank you borgtex, it works.
thanks for all.