homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

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

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

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)

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)

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)

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved