HighRise
07-11-2006, 10:01 AM
I am having an issue with nested tables in IE. Here's my code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test Page</title>
<style type="text/css">
.headerCell
{
height: 25px;
white-space: nowrap;
}
</style>
</head>
<body style="background-color: CCCCCC;">
<table width="100%" cellspacing="0" cellpadding="0" border="1">
<tr>
<td class="headerCell" width="60%">Brief</td>
<td class="headerCell">Id</td>
<td class="headerCell" width="20%">Client</td>
<td class="headerCell" width="20%">Assigned Staff</td>
<td class="headerCell">Status</td>
<td class="headerCell">Total Time</td>
</tr>
<tr>
<td colspan="6" width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="1">
<tr>
<td>User</td>
<td>Description</td>
<td>Comments</td>
<td>Start/End</td>
<td>TotalTime</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
The problem is with the table widths. If you run this in IE and shrink the browser window until the table stops getting smaller, you'll see that it doesn't get as small as it could. Now try it in Firefox and it will work fine (the table gets to the point where it couldn't get any smaller without clipping or wrapping text.)
The really wierd thing is that, if you change the first cell in the outside table to <td class="headerCell" width="60%">Brief Description</td> (just adding the word "Description"), and then reload the page in IE, it works fine! Pretty wierd huh? So what am I doing wrong?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test Page</title>
<style type="text/css">
.headerCell
{
height: 25px;
white-space: nowrap;
}
</style>
</head>
<body style="background-color: CCCCCC;">
<table width="100%" cellspacing="0" cellpadding="0" border="1">
<tr>
<td class="headerCell" width="60%">Brief</td>
<td class="headerCell">Id</td>
<td class="headerCell" width="20%">Client</td>
<td class="headerCell" width="20%">Assigned Staff</td>
<td class="headerCell">Status</td>
<td class="headerCell">Total Time</td>
</tr>
<tr>
<td colspan="6" width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="1">
<tr>
<td>User</td>
<td>Description</td>
<td>Comments</td>
<td>Start/End</td>
<td>TotalTime</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
The problem is with the table widths. If you run this in IE and shrink the browser window until the table stops getting smaller, you'll see that it doesn't get as small as it could. Now try it in Firefox and it will work fine (the table gets to the point where it couldn't get any smaller without clipping or wrapping text.)
The really wierd thing is that, if you change the first cell in the outside table to <td class="headerCell" width="60%">Brief Description</td> (just adding the word "Description"), and then reload the page in IE, it works fine! Pretty wierd huh? So what am I doing wrong?