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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table not working as expected if DOCTYPE included

Status
Not open for further replies.

tshad

Programmer
Joined
Jul 15, 2004
Messages
386
Location
US
I have table that will not work in DW 2004 if I take the New file setup that DW gives me.

Here is what the basic page looks like:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
</body>
</html>

I take this and create a page like so:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
body {margin:0;padding:0;}
</style>
</head>
<body>
<table width="100%"  height="100%" border="1" cellspacing="0" cellpadding="0">
 <tr height="100" bgcolor="#000099">
  <td>&nbsp;</td>
 </tr>
</table>
</body>
</html>

This should just fill the screen with Blue.

There is more to this page than this, I am just trying to demonstrate the problem. I want this table to fill the screen - no matter how big the screen is (this is why the height="100%"). This would normally be a couple of tables with buttons on the left, logo on top and logo on bottom with content in the middle/right.

This code is not working correctly.

But it will if I take out the "<!DOCTYPE " line. This works fine now.

Why is this happening and why is DW adding the line anyways?

Thanks,

Tom.
 
DOC-TYPE is a wonderful thing. It tells you that you're using out-dated methods.

try this:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
body {
	margin:0;
	padding:0;
	width: 100%;
	height: 100%;
	}

#entirePageTable {
	width: 100%;
	height: 100%;
	border: 1px solid black;
	}

</style>
</head>
<body>
<table id="entirePageTable" cellspacing="0" cellpadding="0">
 <tr height="100" bgcolor="#000099">
  <td>&nbsp;</td>
 </tr>
</table>
</body>
</html>

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
hi
in your <body>
add
<bgcolor="blue">
not in the table

cheers


pgtek
 
That's not the correct solution if the asker wants the table to take up the entire page.

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
I am not trying to take up the entire page with blue. Most of the table was taken out to show the problem.

The table would actually look something like:

Code:
<table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0">
  <tr height="100" bgcolor="#000099">
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>
      <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="100" valign="top" bgcolor="#000099">
          </td>				
          <td class="BodyText">asdassdfasdf</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td height="20" bgcolor="#000099"><span class="style1">©2001, All Rights Reserved</span></td>
  </tr>
</table>

I want the copyright to always be on the bottom of the screen, no matter what the height is. This is why I have the height="100%" in the 1st table.

This should work (and does if you don't have the doctype in it). This was also the way some of the people here told me to make this work when I originally set this up months ago (not sure if DW was putting the doctype in it then - I was using DWMX not DWMX2004).

Also, outdated methods should not stop working. I wasted about 3 hours trying to figure out why this perfectly good method doesn't work anymore.

Very irritating.

Thanks,

Tom.
 
>> This should just fill the screen with Blue.

Please be more specific with your questions...

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

I did want to fill in the screen - only to make it simple to see the problem.

With Doctype it was only going down 1/3 of the screen. What I was really trying to do was make sure the bottom of the table went at least to the bottom of the screen (starting from the top) - which does if you don't have the Doctype statement. It can go beyond the bottom of the screen, however - and will with enough content.

Sorry

Thanks,

Tom.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top