Forum Moderators: open
I'm having trouble with some simple code in IE. I'm using rowspan and colspan for a table layout and one of the cells won't align where I need it to be. Of course, it looks great in Firefox. It validates as transitional HTML 4.01.
(No - my client doesn't want any positioning done in CSS).
Can anyone tell me what's wrong here? Please view the code in both Firefox (to see what I want) and IE (to see the problem).
Thanks so very much.
mtmama
I've stripped all code below to bare table cells, with broken images where objects are placed. This is to protect client material.
<html>
<body><table class="pageborder" width="800" cellpadding="0" cellspacing="0" border="2">
<!--top navigation area-->
<tr>
<td valign="top" colspan="3">
<table>
<tr>
<td width="445" bgcolor="#006599" align="left"><div class="topnav">August 1, 2005</div></td>
<td width="345" bgcolor="#006599" align="right"><div class="topnav">Text here</div></td>
</tr>
</table></td>
<!--end top nav area-->
</tr>
<!--begin logo-->
<tr>
<td valign="top" colspan="3" bgcolor="#006599" width="798">
<img align="left" src="" width="663" height="56" alt="company logo here"></td>
</tr>
<!--end logo-->
<!--begin area above main text-->
<tr>
<td width="135" bgcolor="#006599" valign="top" rowspan="2">
<img src="" width="135" height="500">
</td>
<td valign="top" align="left" width="525">
<img src="" width="525" height="51"></td>
<td valign="top" align="left">
<img src="" width="135" height="51" alt=""></td></tr>
<tr>
<!--end area above main text-->
<!--begin main text-->
<td class="main" valign="top" width="630" colspan="2">
Text here</td>
</tr>
<!--end main text-->
</table>
</body>
</html>
When I change between no DTD and using a 4.01 transitional DTD, I see one cell shift it's alignment/size in IE.
It didn't occur to me to take the DTD out and see what happens ...because it has to have a DTD. I'm contracting for a company where I markup the design I create and then it goes to the programmers for application creation. So not only does my code have to validate for compliant browsers, but it has to be standardized for the programmers.
In any case, I went ahead and nested another table inside and that solved the problem. I hate nesting tables, but when you are not using CSS for posititioning, it is sometimes the only work-around. And I couldn't spend one more day pulling my hair out over a stupid table cell that won't vertically align. SIGH. :) But thanks for replying.
mtmama