...

View Full Version : fixed size cell



ahmedsoliman
01-08-2003, 05: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%

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

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

ahmedsoliman
01-08-2003, 11:59 PM
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

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

brothercake
01-09-2003, 03: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.

ahmedsoliman
01-10-2003, 03: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:

http://www.codingforums.com/showthread.php?s=&threadid=12567

sage45
01-10-2003, 05: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???

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

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

Say your table width is 75%



<TABLE WIDTH="75%">


What you can do then is this


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


or you can use specific widths (pixels ofcourse)



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


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...

-sage-

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

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

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

this my test page:
http://www.geocities.com/af_soliman/test1.html

whammy
01-10-2003, 11:40 PM
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...

:)

Borgtex
01-11-2003, 01: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 :(

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum