Log in

View Full Version : align a table to the top of page..



benslayton
05-31-2007, 05:36 PM
how would I align this table to the top of the page? when i use the top margin and set a negative value it turns out differnet in different browsers.. Its either to much or not enough to the top.


<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-color: #666666;
}
-->
</style></head>

<body>
<table width="510" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td width="510" height="88" bgcolor="#999999">This table needs to be moved up to the top of the page. But when using the top margin and using negative pixels looks different in other browsers. </td>
</tr>
</table>
</body>
</html>


1036<-- Download the page here...

I have attached a zip of the above as a .html if that helps.

benslayton
05-31-2007, 06:44 PM
ok i figured it out. i was putting the top margin stuff in the html for the table and not for the body.