Click to See Complete Forum and Search --> : 100% table height


mxs00u
12-17-2004, 07:36 AM
Hi, I know it should be easy but:

I want to make my webpage 100% height so that no matter what the resolution is it will fill the page, however I find that when I do 100% height it doesn't work. i.e. the height will only change depending upon what is inside the table.

I've been told its something to do with my page dtd definition but I can't work out what. My current definition is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Does anybody have any idea how I can get this working??

coothead
12-18-2004, 11:06 AM
Hi there mxs00u,

this is not really the right forum for this question but....

here you go :)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>100% table</title>

<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />

<style type="text/css">
/*<![CDATA[*/

html,body {
height:100%;
margin:0px;
padding:0px;
}

#tbl {
width:100%;
height:100%;
border:solid 1px #000;
}

#tbl td {
width:100%;
height:100%;
border:solid 1px #000;
font-size:28px;
text-align:center;
background:#800;
}

/*//]]>*/
</style>

</head>
<body>

<table id="tbl"><tr>
<td>....one hundred percent table</td>
</tr></table>

</body>
</html>

coothead

mxs00u
12-20-2004, 03:53 AM
thanks m8 that works a treat