Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Footer & DOCTYPE

Reply
Thread Tools

Footer & DOCTYPE

 
 
Goran Topic
Guest
Posts: n/a
 
      12-03-2003
Hello. I'm trying to make a footer, and I tried this (our site uses
table-based layout; don't kill me, please):

<table width="100%" height="100%">
<tr><td>
CONTENT HERE...
</td></tr>
<tr height="20px" bgcolor="blue"><td>
This is the footer
</td></tr>
</table>

And this works as I want it to: if the page is longer than the screen,
the footer goes at the bottom of the document; and if it's shorter, it
goes on the bottom of the screen. However, if I put the DOCTYPE
declaration, it does not work any more:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Can someone help me get this right? I should have the DOCTYPE, but I've
no idea how to get the same functionality with it.

Thanks,

Goran
 
Reply With Quote
 
 
 
 
Matthias Gutfeldt
Guest
Posts: n/a
 
      12-03-2003
Goran Topic wrote:
> Hello. I'm trying to make a footer, and I tried this (our site uses
> table-based layout; don't kill me, please):


Just call it "hybrid layout" to make it buzzword compliant


> <table width="100%" height="100%">
> <tr><td>
> CONTENT HERE...
> </td></tr>
> <tr height="20px" bgcolor="blue"><td>
> This is the footer
> </td></tr>
> </table>
>
> And this works as I want it to: if the page is longer than the screen,
> the footer goes at the bottom of the document; and if it's shorter, it
> goes on the bottom of the screen. However, if I put the DOCTYPE
> declaration, it does not work any more:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
>
> Can someone help me get this right? I should have the DOCTYPE, but I've
> no idea how to get the same functionality with it.


The TABLE element doesn't have a height attribute, see the HTML
specification: <http://www.w3.org/TR/html4/struct/tables.html#edef-TABLE>.

You don't say which browser you tested this in. Without the Doctype,
some browsers will just ignore the specification and apply the height
attribute. With the Doctype, same browsers will respect the
specification, and that means it will ignore the attribute.

Possible solution: Specify the height of the table (or its content) with
CSS.


Matthias

 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      12-03-2003
in post <news:(E-Mail Removed)>
Goran Topic said:

> (our site uses table-based layout; don't kill me, please):


i'm sorry but it just doesn't work like that. death is really the only
solution. why should we kill everyone else and not you? are there
mitigating circumstances we should be aware of?

--
brucie
04/December/2003 12:44:51 am kilo
 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      12-03-2003
Goran Topic <(E-Mail Removed)> wrote:

>Hello. I'm trying to make a footer, and I tried this (our site uses
>table-based layout; don't kill me, please):


Okay. But I think you know why you're having problems.

><table width="100%" height="100%">
> <tr><td>
> CONTENT HERE...
> </td></tr>
> <tr height="20px" bgcolor="blue"><td>


That's wrong. The height attribute takes either a percentage or a
straight numerical value. It never takes a value with "px" tacked on
the end. Be careful that you don't mix up CSS and HTML syntax (lengths
in CSS must always have a unit, only percentage lengths in HTML have
units).

> This is the footer
> </td></tr>
></table>
>
>And this works as I want it to: if the page is longer than the screen,
>the footer goes at the bottom of the document; and if it's shorter, it
>goes on the bottom of the screen. However, if I put the DOCTYPE
>declaration, it does not work any more:
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>"http://www.w3.org/TR/html4/loose.dtd">


That doctype triggers standards mode in certain browsers (IE5 Mac, IE6
Win, Gecko based browsers, Opera 7) and in standards mode the invalid
height="100%" is ignored.

> I should have the DOCTYPE, but I've no idea how to get the same functionality with it.


Why should you have the doctype? If you have <table height="100%">
then your page is _not_ HTML 4.01 Transitional so putting that doctype
there is telling a lie.

Either get rid of the height attribute or get rid of the doctype.

Or if you want to carry on telling lies you can change the doctype to
one that triggers quirks mode rather than standards mode (for example,
just delete the URL from the one above).

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
DU
Guest
Posts: n/a
 
      12-04-2003
Goran Topic wrote:

> Hello. I'm trying to make a footer, and I tried this (our site uses
> table-based layout; don't kill me, please):
>
> <table width="100%" height="100%">
> <tr><td>
> CONTENT HERE...
> </td></tr>
> <tr height="20px" bgcolor="blue"><td>
> This is the footer
> </td></tr>
> </table>
>
> And this works as I want it to: if the page is longer than the screen,
> the footer goes at the bottom of the document; and if it's shorter, it
> goes on the bottom of the screen. However, if I put the DOCTYPE
> declaration, it does not work any more:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
>
> Can someone help me get this right? I should have the DOCTYPE, but I've
> no idea how to get the same functionality with it.
>
> Thanks,
>
> Goran


Why didn't you just use entirely valid code in a tableless webpage
design? This is where your markup code and design will work on a
multitude of web-aware devices, platforms, compliant browsers, etc..
If you really need to use a table for tabular data, then why not use the
tfoot element?

http://www.w3.org/TR/html401/struct/....html#h-11.2.3

Can you give an url of your webpage? That way, we could better suggest a
way for you to achieve your webpage requirements with web standards
compliance.

DU

 
Reply With Quote
 
Nico Schuyt
Guest
Posts: n/a
 
      12-04-2003
DU wrote:
>> Hello. I'm trying to make a footer, and I tried this (our site uses
>> table-based layout; don't kill me, please):
>> <table width="100%" height="100%">
>> <snip>
>> </table>
>> And this works as I want it to: if the page is longer than the
>> screen, the footer goes at the bottom of the document; and if it's
>> shorter, it goes on the bottom of the screen. However, if I put the
>> DOCTYPE declaration, it does not work any more:


> Why didn't you just use entirely valid code in a tableless webpage
> design? This is where your markup code and design will work on a
> multitude of web-aware devices, platforms, compliant browsers, etc..


Well, I'm not so sure about that
http://www.nicoschuyt.nl/test/footer.htm is an example of a tableless
solution for scrollable text with footer.
Bad keyboard navigation however and in browsers like Opera7.2 and Mozilla1.4
the scroll mouse is inactive.
Probably even more problems than frames
Nico


 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      12-04-2003
in post <news:3fcefaeb$0$4663$(E-Mail Removed)>
Nico Schuyt said:

>> Why didn't you just use entirely valid code in a tableless webpage
>> design? This is where your markup code and design will work on a
>> multitude of web-aware devices, platforms, compliant browsers, etc..


> Well, I'm not so sure about that
> http://www.nicoschuyt.nl/test/footer.htm is an example of a tableless
> solution for scrollable text with footer.
> Bad keyboard navigation however and in browsers like Opera7.2 and Mozilla1.4
> the scroll mouse is inactive.
> Probably even more problems than frames


a simpler solution would have just been to position a <div> at the
bottom of the window (or anywhere else you wanted it) with
position:fixed; so it remains in the location while everything else
scrolls.

easy peasy except once again for IE. you'll need the position fixed
fix. http://devnull.tagsoup.com/fixed/


--
brucie
04/December/2003 07:25:38 pm kilo
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      12-04-2003
Steve Pugh <(E-Mail Removed)> wrote:

> Or if you want to carry on telling lies you can change the doctype to
> one that triggers quirks mode rather than standards mode


Alternatively, if you wish to tell the truth and you wish to use a
doctype declaration, you can create your copy of the Transitional DDT,
add a line that tells that a table element may have a height attribute,
upload the DTD onto a Web server, and refer to it your <!doctype>.

I'm pretty sure this will trigger "bug compatible" (aka. "quirks") mode
in current bwowsers. It will also let you check the markup syntax using
an SGML validator - why else would you use a <!doctype>?

Your page won't conform to any HTML specification, since all
specifications mandate the use of specific DTDs, even up to using a
specific way of referring them. But the great majority of Web pages
fails to conform, and virtually all bwowsers fail too, so you shouldn't
feel too sinful.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
Goran Topic
Guest
Posts: n/a
 
      12-04-2003
In article <bqksrg$242nii$(E-Mail Removed)-berlin.de>,
Matthias Gutfeldt wrote:
> Goran Topic wrote:
>> Hello. I'm trying to make a footer, and I tried this (our site uses
>> table-based layout; don't kill me, please):

>
> Just call it "hybrid layout" to make it buzzword compliant


Naah... I'll leave that to my bosses.

> The TABLE element doesn't have a height attribute, see the HTML
> specification: <http://www.w3.org/TR/html4/struct/tables.html#edef-TABLE>.


That didn't even cross my mind! Thanks...

> You don't say which browser you tested this in. Without the Doctype,


IE and Firebird

Goran
 
Reply With Quote
 
Eric Bohlman
Guest
Posts: n/a
 
      12-04-2003
"Jukka K. Korpela" <(E-Mail Removed)> wrote in
news:Xns94477B18C4331jkorpelacstutfi@193.229.0.31:

> Alternatively, if you wish to tell the truth and you wish to use a
> doctype declaration, you can create your copy of the Transitional DDT,


Wasn't it Tina Marie Holmboe who, several years ago, wrote a parody of the
Ramones' "Teenage Lobotomy" that began with "DTD did a job on me"?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Newbie - CSS Works With Invalid DOCTYPE. Fails With Valid DOCTYPE. Larry Lindstrom HTML 19 06-12-2012 02:07 PM
Any way to reorder how a datagrid is drawn (header/footer/items vs.header/items/footer)? Henrik ASP .Net Datagrid Control 1 07-06-2006 12:23 AM
DOCTYPE declarations not generated by ASP.NET Neil Zanella ASP .Net 3 01-04-2005 11:18 PM
Setting DocType in Asp.Net Kenneth Keeley ASP .Net 1 06-30-2004 01:59 PM
vs.net creates doctype wrong? Ian ASP .Net 2 06-21-2004 12:32 PM



Advertisments