navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Fixed <TR> height in table with strict doctype

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Fixed <TR> height in table with strict doctype
Page: [1]
 
RowanReid

 

Posts: 2
Joined: 4/4/2008
Status: offline

 
Fixed <TR> height in table with strict doctype - 4/8/2008 5:02:45   
Hi There,

I have included my code below. The table looks correct in Firefox 2 and Safari 3 but not IE7.

I am attempting to create a table that fills up the entire page with a fixed width row at the bottom. IE7 ignores the height I have set for the second row and makes both rows the same height.

Note that the Doctype tag is important here, if I remove it then the page looks correct, however it is my intention to ensure the browser runs in standards mode. As far as I am aware my code is correct.

Any help or advice would be appreciated.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<style>
		html,body{
	   margin:0;
	   padding:0;
	   height:100%;
	   border:none;
		}
</style>
</head>
<table height="100%" cellpadding="0" cellspacing="0" border="1" width="100%">
	<tr>
		<td>
			Line 1
		</td>
	</tr>
	<tr style="height:10px;">
		<td>
			Line 2
		</td>
	</tr>
</table>
</html>
Tailslide

 

Posts: 6032
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Fixed <TR> height in table with strict doctype - 4/8/2008 6:39:38   
Hi

I'm not very good with tables but this seems to work:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
   <style type="text/css">
      html,body{
      margin:0;
      padding:0;
      height:100%;
      border:none;
      }
</style>
</head>
<body>
  <table border="1" cellpadding="0" cellspacing="0" style="width:100%;height:100%;">
    <tbody style="width:100%;height:90%;">
      <tr><td>Stuff goes here</td></tr>
      <tr style="height:10px;"><td>Stuff in the 10px high div</td></tr>
    </tbody>
 </table>
</body>
</html>


I should say however that if you're putting any text into the 10px high div then you're risking the layout breaking if someone increases the text-size. Generally if there's text there, you're better off with percentages.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to RowanReid)
RowanReid

 

Posts: 2
Joined: 4/4/2008
Status: offline

 
RE: Fixed <TR> height in table with strict doctype - 4/9/2008 5:14:53   
Great, thanks for the help!

(in reply to RowanReid)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Fixed <TR> height in table with strict doctype
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts