Welcome to WebmasterWorld Guest from 54.145.71.115

Forum Moderators: incrediBILL

Message Too Old, No Replies

width of cell in table

     

manjumurthy

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

Inactive Member
Account Expired

 
 


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 Sept 5, 2001 (gmt 0)

Full Member

joined:June 21, 2000
posts:339
votes: 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

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

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 0


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 Sept 6, 2001 (gmt 0)

Full Member

joined:June 21, 2000
posts:339
votes: 0


Sorry for the bum lead Manju.

Brian

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 10, 2001
posts:793
votes: 0


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.