|
| |
|
|
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
|
|
|
|
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!
|
|
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
|
|
|