Posts: 18
Location: Essex, United Kingdom
|
Can anyone tell me why i cannot get this code to work, and more importantly, what i need to do to make it work?
HTML Code:
<!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-GB" lang="en-GB">
<head>
<style>
html {height:100%}
body {height:100%; padding:0px; margin:20px}
.table {height:100%; width:100%; border:1px solid blue; background-color:yellow}
</style>
</head>
<body>
<table class="table">
<tr>
<td> </td>
</tr>
</table>
</body>
</html>
I am simply trying to make a table 100% height and width of the page. (I know i shouldn't use tables, but i don't have a choice). If i set the body style to have no margin, it works fine. However, if place a margin on the body (as is required), scroll bars appear, and the page is too long. This only seems to affect IE.
How can i get around this?
|