PDA

View Full Version : Why the scrollbar?



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>&nbsp;</td></table>
</td></table>
</body>
</html>

Jesdisciple
06-20-2009, 05:48 PM
I bet it's because your screen is bigger than your viewport. http://www.google.com/search?hl=en&q=browser+viewport