Forum Moderators: open
I wrote some quick code I thought would accomplish this. As I was on a Mac at the time, I checked it in all available browsers (Safari, IE, Firefox, Mozilla) and it looked fine on them all. Then I check on IE6 and it didn't. I've boiled the html down to nothing and isolated the problem. (I don't think it's related to the box model issue but I'm not sure.)
The problem is this: if the right side of the image passes the end of the text in the cell below, the table width will suddenly increase its width to greater than the window size. Here's the code.
<html>
<head>
</head>
<body>
<table border="1" width="100%" height="100%">
<tr>
<!--as soon as img width is great enough, page width increases!-->
<td width="100%" colspan="2" nowrap><img width="550" height="50"></td>
</tr>
<tr>
<td width="300" height="100%" nowrap rowspan="2"></td>
<td width="100%" height="24" valign="top" nowrap>The right side of the image must end by here --> ¦</td>
</tr>
</table>
</body>
</html>
Like I said, this is the barest bones of the page but I'm pretty sure I've isolated the problem here.
THANKS SO MUCH FOR THE HELP!
Please note the difference between the page in its current form and the page if the image width is changed to, for example, 650.
Thanks!
Thanks for sticking with me. I need to figure this one out!
Strangely enough when I got home this afternoon and tried it again it did expand too far!
IE can be really quirky when it's quirky...
But I think this will fix you right up.
You really don't need the 100% width for that cell, it was causing IE to do 100% of the table width. Try this without it in there.
<html>
<head>
</head>
<body>
<table border="1" width="100%" height="100%">
<tr>
<!--as soon as img width is great enough, page width increases!-->
<td colspan="2"><img width="750" height="50"></td>
</tr>
<tr>
<td width="300" height="100%" nowrap rowspan="2"></td>
<td height="24" valign="top" nowrap>The right side of the image must end by here --> ¦</td>
</tr>
</table>
</body>
</html>
Added note:
You already have the table width set at 100%, and the left td has a width of 300, so the text block td will expand out to fill the 100% table width.
<table border="0" cellpadding="0" cellspacing="3" width="100%" height="100%">
<tr>
<td width="100%" height="100" colspan="3" nowrap bgcolor="#CC0000" valign="middle" align="left"><img width="687" height="52" border="0"></td>
</tr>
<tr>
<td width="100%" height="24" colspan="3" nowrap bgcolor="#333333" class="heading"></td>
</tr>
<tr>
<td width="100%" colspan="3"></td>
</tr>
<tr>
<td width="400" height="24" colspan="2" nowrap bgcolor="#333333" class="heading"></td>
<td width="100%" height="24" nowrap bgcolor="#333333" class="heading"></td>
</tr>
<tr>
<td width="100" height="100" nowrap class="trackNum" valign="middle" align="center"></td>
<td width="300" height="100" nowrap bgcolor="#CCCCCC"></td>
<td width="100%" height="100%" rowspan="4" valign="top" align="left"></td>
</tr>
<tr>
<td width="100" height="100" nowrap class="trackNum" valign="middle" align="center"></td>
<td width="300" height="100" nowrap bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td width="100" height="100" nowrap class="trackNum" valign="middle" align="center"></td>
<td width="300" height="100" nowrap bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td width="400" height="100%" colspan="2" nowrap></td>
</tr>
</table>
Now, removing the 100% widths will make the table fit on the window BUT the width of the light gray cells will no longer be static! What the #$)#@*@?! The leftmost column should have a fixed width. The middle (light gray) column should have a fixed width. Only the right (white) column should stretch.
Gosh this is frustrating.
Thanks!
<table border="0" cellpadding="0" cellspacing="3" width="100%">
<tr>
<td width="100%" height="100" colspan="3" nowrap bgcolor="#CC0000" valign="middle" align="left"><img width="687" height="52" border="0"></td>
</tr>
<table border="0" cellpadding="0" cellspacing="3" width="100%" height="100%">
<tr>
<td width="100%" height="24" colspan="3" nowrap bgcolor="#333333" class="heading"></td>
</tr>
<tr>
<td width="100%" colspan="3"></td>
</tr>
<tr>
<td width="400" height="24" colspan="2" nowrap bgcolor="#333333" class="heading"></td>
<td width="100%" height="24" nowrap bgcolor="#333333" class="heading"></td>
</tr>
<tr>
<td width="100" height="100" nowrap class="trackNum" valign="middle" align="center"></td>
<td width="300" height="100" nowrap bgcolor="#CCCCCC"></td>
<td width="100%" height="100%" rowspan="4" valign="top" align="left"></td>
</tr>
<tr>
<td width="100" height="100" nowrap class="trackNum" valign="middle" align="center"></td>
<td width="300" height="100" nowrap bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td width="100" height="100" nowrap class="trackNum" valign="middle" align="center"></td>
<td width="300" height="100" nowrap bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td width="400" height="100%" colspan="2" nowrap></td>
</tr>
</table>
That's a kludge, but the only way I've found so far to make it display correctly in IE.
see this thread [webmasterworld.com] for more details..
So something else to try...remove all widths from the cells and add this:
<table border="0" cellpadding="0" cellspacing="3" width="100%" height="100%" style="table-layout: fixed;">
<colgroup>
<col width="100" />
<col width="300" />
<col width="*" />
</colgroup>
<tr>...etc
Suzy