Jump to content


html table height and other stuff


5 replies to this topic

#1 Prelithe

    Young Padawan

  • Members
  • Pip
  • 50 posts

Posted 02 May 2006 - 05:07 AM

OK, i wanna have a table (3,1) that stretches vertically fully (i.e. 100% height). The first cell is the header, with a fixed height (e.g. 100px). The next is content which can be left alone. the last is the header which is also fixed size (e.g. 100px). Ok trying this, it works fine in FF, but in IE, the cells refuse to stay fixed. Wheneverthe 100% of the table is added, the rest turn into percentages. Can someone enlighten me on the way to make it work in IE? If you can code it in CSS (divs and css) I'll love you forever.

Here's a quick paint drawing on what i wanna achieve.
Posted Image

Eventhere is not enough content text to stretch the table, I still want it to stetch 100% height.

#2 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 02 May 2006 - 05:11 AM

do you have the file live on internet somewhere?

#3 Prelithe

    Young Padawan

  • Members
  • Pip
  • 50 posts

Posted 02 May 2006 - 06:17 AM

no, but here's the source of stuff:

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--

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

body {
	background: url(images/bg.gif) #FFF;
	font-family: Arial, sans-serif;
	font-size: 12px;
}
#container {
	width: 826px;
	background: url(images/bg2.gif) #FFF repeat-y center;
	height: 100%
}
#header {
	text-align: center;
	vertical-align: top;
	height: 147px;
}
#footer {
	background: url(images/bg3.gif) center repeat-y;
	color: #FFF;
	padding: 9px;
	height: 50px;
	text-align: center;
	
}
#content {
	padding-left: 10px;
	padding-right: 10px;
	vertical-align:top;
	
}
-->

</style></head>

<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" id="container">
  <tr>
	<td valign="top" id="header"><img src="images/banner.jpg" alt="" width="808" height="147" /></td>
  </tr>
  <tr>
	<td valign="top" id="content"><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam sed neque euismod ante mattis vestibulum. Nunc id mi 
	  in lorem porta onsectetuer. Nulla facilisi. Cras pharetra lobortis pede. Morbi suscipit libero sed tortor. Vestibulum sit 
	  amet nisi. Maecenas sit amet eros id mi suscipit blandit. Pellentesque tempor aliquam augue. In blandit. Vivamus ligula 
	  arcu, varius quis, vulputate a, condimentum ac, nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices 
	  posuere cubilia Curae; Nam a orci in augue volutpat rutrum. Sed et leo. Nulla cursus risus vel pede. Etiam ipsum arcu, 
	  tempor tempor, dictum eu, sollicitudin eget, lacus.</p>
	  <p>&nbsp;</p>
	<p>&nbsp;</p></td>
  </tr>
  <tr>
	<td id="footer">Copyright &copy; 2006, All Rights Reserved	</td>
  </tr>
</table>

</body>
</html>


#4 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 02 May 2006 - 04:38 PM

simply put, you cant...

well.. actually.. i never tried with tables...


add height:100% to both the body tag and the table cell you want 100% height. then fill in the cell with dummy content until the scrollbar appears. if everything works fine, then it works!

#5 Prelithe

    Young Padawan

  • Members
  • Pip
  • 50 posts

Posted 02 May 2006 - 05:29 PM

I want the table to stretch 100% of the window. I can do that, but the other cells with fixed height don't stay fixed in IE! So really i have no ideas on how to conquer that. Tried it with divs, i cannot get a div to stay stuck right at the bottom and align to center, works with FF, but not IE.....

#6 ecntrc

    Young Padawan

  • Members
  • Pip
  • 48 posts
  • Location:Hawaii
  • Interests:designing, coding is my favorite.. more than graphics.. im a stay at home mom and a web master from home.. so.. teaching my son and computers and my web design.. pretty much it.. reading.. i love john grisham..

Posted 02 May 2006 - 05:39 PM

id say br's would work but im like uh no. im not too sure.. maybe try and google it or think of some other way to do it.. or maybe putting another row on the bottom of the ones that wont stay in IE, and put a br in that? would that work? I could totally be wrong.. but jsut wanted to say what i thought..





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users