Click to See Complete Forum and Search --> : 100% height a myth?


triso
05-04-2005, 11:40 AM
So I’ve read multiple topics on the subject and have not found an answer. I beginning to think it’s damn near impossible to use 100% height.

I want a table to be reach to the bottom of the browser window or view port, regardless of content, and I’ve tried using CSS, and everything else and it is still not working for me.

Is there a way to do this … or am I wasting my time?

coothead
05-04-2005, 12:50 PM
Hi there triso,

it's not a myth, it's here before your very eyes....
<!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" xml:lang="en" lang="en">
<head>
<title>100% table height</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;
}
#tab1 {
width:100%;
height:100%;
background:#fcc;
}
#tab1 td {
text-align:center;
}
/*//]]>*/
</style>

</head>
<body>

<table id="tab1"><tr>
<td>this is a one hundred percent high table</td>
</tr></table>

</body>
</html>

coothead

sparq
05-04-2005, 03:49 PM
Wouldnt....

<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">

<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr><Td align="middle" bgcolor="#C0C0C0">This is 100% as well... most of the time</td></tr>
</table>


Also do the same thing... for most browsers?

felgall
05-04-2005, 04:35 PM
You should use CSS for page layout. Tables are for displaying tabular data.

coothead
05-04-2005, 04:39 PM
Hi there sparq,

Wouldn't....

Also do the same thing... for most browsers?

Well, no it wouldn't.
And...

topmargin is deprecated
leftmargin is deprecated
rightmargin is deprecated
bottommargin is deprecated
align canot be middle


Has CSS passed you by. :D

coothead

triso
05-04-2005, 05:34 PM
Actually i normally do use CSS for page layout ... however at my job they REFUSE to let me use it ... saying there are to many browser issues :(

memark
05-04-2005, 06:25 PM
That was maybe the case five years ago. Today that's just ridiculs. Hang in there!

Maybe you can show them something like
http://www.csszengarden.com/
to make them understand the power and easy of CSS.