ArchibaldBarashol
06-16-2009, 06:01 PM
I used this simple little code to center a table in the middle of a screen based on resolution. When I run it, though, I'm getting a table bigger than the screen with vertical and horizontal scroll bars. Can anyone see why?
Thanks,
Arch
<html>
<head>
<title>Untitled document</title>
</head>
<body TOPMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0>
<script type="text/javascript">
document.write('<table width='+screen.width+' height='+screen.height+' bgcolor=blue
cellpadding=0 cellspacing=0><td width='+screen.width+' height='+screen.height+' align=center
valign=center>')</script>
<table width=600 height=300 bgcolor=red cellpadding=0 cellspacing=0><td width=600
height=300> </td></table>
</td></table>
</body>
</html>
Thanks,
Arch
<html>
<head>
<title>Untitled document</title>
</head>
<body TOPMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0>
<script type="text/javascript">
document.write('<table width='+screen.width+' height='+screen.height+' bgcolor=blue
cellpadding=0 cellspacing=0><td width='+screen.width+' height='+screen.height+' align=center
valign=center>')</script>
<table width=600 height=300 bgcolor=red cellpadding=0 cellspacing=0><td width=600
height=300> </td></table>
</td></table>
</body>
</html>