Welcome to WebmasterWorld Guest from 54.226.62.251

Forum Moderators: incrediBILL

Message Too Old, No Replies

width of cell in table

     

manjumurthy

1:03 pm on Sep 5, 2001 (gmt 0)



Hi all,
i would like to know how to prevent the cell width from increasing as its content also increases.(i mean when the content is a single word with more characters). i used the property of nowrap which works only for multiple words
thanx
manjumurthy

GWJ

1:43 pm on Sep 5, 2001 (gmt 0)



Hi,

I would go about setting the <td> tag to a specified pixel width. An example would be...

<TD WIDTH=600 BGCOLOR="#FFFFFF">Example</TD>

This way the cell is restricted to a certain pixel setting for width of the cell.

Brian

tedster

2:37 am on Sep 6, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Browsers may still increase the rendered width of a cell, even if it's been set by pixels, in order to handle the cell content (such as manju's single word situation, where there is no space for the browser to use as an allowed line break).

Their may some CSS-2 method to handle this (CSS-2 gets into lots of table stuff that was not addressed in CSS-1). However, CSS-2 is still far from well supported by browsers.

So, I don't think that there is a dependable way to do this right now.

GWJ

11:58 am on Sep 6, 2001 (gmt 0)



Sorry for the bum lead Manju.

Brian

joshie76

1:42 pm on Sep 6, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could always nest a non-overflowing div tag in your cell... something along the lines of

<table>
<tr>
<td width="30">
<div width="30" style="overflow:hidden">
content here
</div>
</td>
</tr>
</table>

Let me know how you get on.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month