Welcome to WebmasterWorld Guest from 54.161.110.186

Forum Moderators: incrediBILL

Message Too Old, No Replies

Cells in the same column, do they have to be the same width?

     
8:49 pm on Feb 4, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In working with a table, say 3 columns wide by 10 rows high, I have an image in the upper-left firstmost cell. Say the image is 200 wide. 5 rows down, I have an image 100 wide in the same column. The cell is rendered as wide as the one with the 200 wide image, causing unwanted white space between it and the next cell in the row.

In the past, I have just nested another table in that row, and was able to size the cells however I wanted. But since reading BT's findings on not going deeper than 2 nested tables (I already have 2 nested), I don't want to do this.

Is there any way to work around this, without using nested tables?
I hope this makes sense.

9:00 pm on Feb 4, 2001 (gmt 0)

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



If I understand you correctly, there are two options I can think of. One is to use <td align=right> to bump the image up against the next cell in the row.

You could also make the table four columns wide instead of three, and use two 100 pixel columns instead of one at 200 pixels. Then use <td colspan=2> where you need the 200 pixel width.

Edited by: tedster

2:29 am on Feb 5, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A column is always going to be at least as wide as the widest item anywhere in the column. As tedster suggested, colspan tags can often get you around it. If the upper left cell spanned two columns, the next widest element in the left column would then become the minumun column width.
2:16 am on Feb 6, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks guys, playing around some more with colspan/rowspan did it. I was already trying to make it work this way but had too many instances of them not jiving with each other. The page I am working with is a bit more complex than the simplified-for-posting-clarity example I used above, but you pointed me in the right direction.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month