 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
altrent
Joined: 21 Apr 2005 Posts: 2
|
Posted: Thu Apr 21, 2005 11:51 am Table, colspan and width in IE |
|
|
|
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: 8316 Location: Castle Pines North, CO USA
|
Posted: Thu Apr 21, 2005 1:43 pm |
|
|
|
Can you just use two separate tables? |
|
altrent
Joined: 21 Apr 2005 Posts: 2
|
Posted: Thu Apr 21, 2005 4:49 pm |
|
|
|
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: 8316 Location: Castle Pines North, CO USA
|
Posted: Thu Apr 21, 2005 4:52 pm |
|
|
|
| Anytime - good luck with the site! |
|
|
|
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
|
|
|
|
|
 |
|
|
|
|
|
|
|