Forum Moderators: not2easy
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
[sample code added]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>.:: Test Doc ::.</title>
<style type="text/css">
<!--
body{
margin: 0px;
padding: 0px;
font-family: Arial, sans-serif;
font-size:12px;
color:#000000
}
.cell {
width:25px;
height:20px;
border-right: 1px solid #30549E;
border-bottom: 1px solid #30549E;
background-color:#DBE7F0;
}
.cellDark{
width:25px;
height:20px;
border-right: 1px solid #30549E;
border-bottom: 1px solid #30549E;
background-color:#BED3E9;
}
-->
</style>
</head><body>
<table border="0" cellspacing="0" cellpadding="0" align="left" >
<tr>
<td align="center" valign="middle" class="cell"> </td>
<td align="center" valign="middle" class="cell"> </td>
<td align="center" valign="middle" class="cell"> </td>
<td align="center" valign="middle" class="cell"> </td>
<td align="center" valign="middle" class="cell"> </td>
<td align="center" valign="middle" class="cellDark"> </td>
<td align="center" valign="middle" class="cellDark"> </td>
<td align="center" valign="middle" class="cell"> </td>
<td align="center" valign="middle" class="cell"> </td>
<td align="center" valign="middle" class="cell"> </td>
<td align="center" valign="middle" class="cell"> </td>
<td align="center" valign="middle" class="cellDark"> </td>
<td align="center" valign="middle" class="cellDark"> </td>
</tr>
</table></body>
</html>
there are many more rows and columns but this should be enough to see
[edited by: SuzyUK at 9:32 am (utc) on Mar. 26, 2007]
[edit reason] Please no URI's per TOS #13 [WebmasterWorld.com] [/edit]
It is pretty weird that in width I already managed to tell the browsers that this should be rendered equally but I can not do that for the height ... Looking forward to see your decision ;-) Thanks in advance for that!
[edited by: Robin_reala at 9:08 pm (utc) on Mar. 26, 2007]
[edit reason] Removing URL as per TOS #13 [webmasterworld.com] [/edit]
I think the different height comes from the different interpretation of box model by IE6 and Mozilla(I don't have any other reasonable explanations): the one takes the total width of a box TOGETHER with its borders and the other takes the defined width as a container width and adds the borders OUTSIDE. Just I'm looking for a way how to get around that and till this moments I have read hundreds of tuts and postings and nobody knows exactly the decision. Hope here I will find it
You're right about that ;)
Padding on the cells will ruin your height, as will borders. Also, since IE 6 interprets your height value fluidly,
line-height along with font-size could also be mucking with it. If you can barebones all of those properties (no padding, no borders, 1px
line-height and font-size) then you'll hit it :) Just out of curiosity, has anybody asked you about purpose?
By the looks of the eensy-weensy height and width you have there, it doesn't particularly look like you're using the table for tabular data...
and yes there's a way to achieve it with the easiest solution being a conditional because of the need to target only IE6/7
here was presuming a 25px content height + 5px border
CSS:
td {
width: 25px;
height: 30px; /* height including 1 x 5px border */
}CC
<!--[if gte IE 6]>
<style type="text/css" media="screen">tr {height: 30px;} /* height including 1 x 5px border IE 6 & 7 */
td {height: 100%;}</style>
<![endif]-->
the cells in IE6/7 inherit the height from the row instead this seems to work in my tests anyway (presuming the compliant rendering Doctype in your code)
Suzy
So, once again guys, thank you for your help!