Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

height=100%

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
I have a table that sizes to 100%, upon first loaind it looks fine, but when I click to a new page with the same design it puts a space at the bottom of the window and does not size 100% but rather like 98% ... anyone know why?

[conehead]
 
code?

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
Code:
<html>
<head>

<!-- #include file="includes/style.html" -->

</head>
<body topmargin="0" leftmargin="0">
<table width="800" height="100%" cellpadding="0" cellspacing="0" border="0" align="center">
	<tr>
		<td width="19" background="images/side_l.gif"><img src="images/clear.gif" width="19"></td>
		<td valign="top">
			<table width="762" height="100%" cellpadding="0" cellspacing="0" border="0" >
				<tr>
					<td valign="top" height="10"><img src="images/head.gif" border="0""></td>
				</tr>
				<tr>
					<td valign="top" height="50"><img src="images/design.jpg" border="0""></td>
				</tr>
				<tr>
					<td valign="top" background="images/bg_content.gif">
					<table width="762" cellpadding="0" cellspacing="0" border="0" >
						<!-- #include file="includes/nav.asp" -->
					</table>
					
					</td>
				</tr>
				<tr>
					<td height="46" ><img src="images/footer.gif" border="0" alt="footer"></td>
				</tr>
			</table>
		
		
		</td>
		<td width="19" background="images/side_r.gif"><img src="images/clear.gif" width="19"></td>
	</tr>
	
</table>
</body>
</html>

[conehead]
 
Before we go any further on this, I should tell you that height of 100% is not valid.

You should really use a complete doctype in your website, and use the validator. It is extremely important to use the complete doctype.

As for the problem you're seeing, it could be due to this (once I put a complete doctype in your page, the table was no longer taking up the entire screen), or it could be due to the fact that you're including an html file in your <head></head> tags.


Reference:
*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 

Another method of the 100% height problem would be a solution I outlined for guitardave78 earlier. Use JavaScript in the onload and onresize events of the body to set the height at run time.

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
You can use a stylesheet to make the table 100% high. That was how i was ding it b4 i changed to layers

you need to give the table a class and make the class have a 100% height

.table{
height:100%;
width:800px;
}
<table class="table">

not sure that solves your problems though lol

 
GuitarDave78-

While that will work in Quirks Mode, once you give your webpage a complete doctype, height: 100% no longer works. It's not the right way to go about it...

:(

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top