HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Table, colspan and width in IE
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
altrent



Joined: 21 Apr 2005
Posts: 2

PostPosted: Thu Apr 21, 2005 11:51 am     Table, colspan and width in IE Reply with quote

Hello,

I am trying to create a table layout for my site with a header (colspan=2), a content cell (second row, on the left) and a menu cell (second row on the right). When I use a large image in the header cell, I can not get the correct width for either the menu or the content.

Please take a look at below example:

http://netspio.gotdns.com/table.html

Any help would be greatly appreciated! (and any solution would do, (div or not)).

Thanks!

CODE:
Code:

<html>
<head>
<title>table test</title>
<style type="text/css">
table {
    margin:0px;
    padding: 0px;
}
td.menu {
    width:150px;
    text-align: right;
    border:1px solid red;
}
</style>
</head>
<body>

In below table, the b cell is not wide enough:
<table border=1 style="width:100%;">
<tr><td colspan="2"><img src="long.gif" alt="long image"/>sometext</td></tr>
<tr><td>b</td><td class="menu">mustbe150pxwidth</td></tr>

</table>
<br/><br/>
When I add width:100% to the b cell, then the red cell doesn't go "under" the long image anymore (resize the browser window):
<table border=1 style="width:100%;">
<tr><td colspan="2"><img src="long.gif" alt="long image"/>sometext</td></tr>
<tr><td style="width:100%;">b</td><td class="menu">mustbe150pxwidthmax</td></tr>
</table>
</body>
</html>
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8205
Location: Castle Rock CO USA

PostPosted: Thu Apr 21, 2005 1:43 pm     Reply with quote



Can you just use two separate tables?
altrent



Joined: 21 Apr 2005
Posts: 2

PostPosted: Thu Apr 21, 2005 4:49 pm     Reply with quote

You're right. I don't know why I haven't thought about this, but nesting a table in the second row does the trick.

Thank you!
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8205
Location: Castle Rock CO USA

PostPosted: Thu Apr 21, 2005 4:52 pm     Reply with quote

Anytime - good luck with the site!
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial