I have a table that displays database records. It worked fine until I added a <div> tag above the <table> code.
Here is my page in IE:
[img]
…and here it is in Firefox 1.0 Final
[img]
Has anyone ever seen anything like this before? Usually, IE is the one I have trouble with. ?
Here is the relavent code:
[code=php]
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<title>Database Records – Project H.O.P.E – Groups</title>
<link rel=”stylesheet” type=”text/css” href=”style.css” />
</head>
<body>
<form id=’formAction’ name=’formAction’>
<p>
<div class=’functions’>
<center>Project H.O.P.E. Database</center>
<input type=’button’ value=’Delete’ onclick=’deleteRecords()’ />
<input type=’button’ value=’Email’ onclick=’emailPeople()’ />
</div></p>
<p>
<table style=”display:block;border:1px solid black;margin:1px;position:relative;” border=”0″ cellspacing=”3″ cellpadding=”0″ align=”center”>
<tr>
<td align=”center” bgcolor=”#D7FFD7″ height=”40″ valign=”top”>
<div style=”clear:both”><strong>All</strong><br /><input type=’checkbox’ onchange=’checkAll()’ id=’allCheck’ /></div>
</td>
<td align=”center” bgcolor=”#D7FFD7″ height=”40″ valign=”top”>
<div style=”clear:both”><strong>ID<br />(<a href=”?ID=on&field=ID&order=asc”>+</a>/<a href=”?ID=on&field=ID&order=desc”>-</a>)</strong></div>
</td>
</tr>
<tr>
<td bgcolor=”#EFE0E0″ align=”center” height=”40″ valign=”middle”><div style=”clear:both”><input type=’checkbox’ value=’7′ /></div>
</td>
<td bgcolor=”#EFE0E0″>7
</td>
</tr>
<tr>
<td bgcolor=”#D9DAFF” align=”center” height=”40″ valign=”middle”><div style=”clear:both”><input type=’checkbox’ value=’11’ /></div>
</td>
<td bgcolor=”#D9DAFF”>11</td>
</tr>
</table>
</p>
<p>
<div class=’functions’>
<input type=’button’ value=’Delete’ onclick=’deleteRecords()’ />
<input type=’button’ value=’Email’ onclick=’emailPeople()’ />
</div>
</p>
<input type=’hidden’ id=’numRecs’ value=’2′ /></form>
</body>
</html>
[code=php]
/*Contents of style.css*/
.functions{
float:left;
border-color:#0000FF;
border-style:solid;
border-width:1px;
padding:1px;
margin:1px;
background-color:#D9DAFF;
width:100%;
height:auto;
text-align:left;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:24px;
color:#fefeff;
font-weight:900;
position:relative;
}
body {
color:#333;
background-image: url(“images/silverStripe.jpg”);
margin:20px;
padding:0px;
font:11px verdana, arial, helvetica, sans-serif;
}
It looks like to me that instead of the table respecting is relative positon, it renders at the coordinate (20,20) because the body’s padding is set to 20px. That doesn’t explain why the table is off to the right though.
Any help would be appreciated. ?