![]() |
Footer & DOCTYPE
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 |
Re: Footer & DOCTYPE
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 |
Re: Footer & DOCTYPE
in post <news:slrnbsrsc8.gmt.amadan@home.irb.hr>
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 |
Re: Footer & DOCTYPE
Goran Topic <amadan@mad.scientist.com> 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 <steve@pugh.net> <http://steve.pugh.net/> |
Re: Footer & DOCTYPE
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 |
Re: Footer & DOCTYPE
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 |
Re: Footer & DOCTYPE
in post <news:3fcefaeb$0$4663$1b62eedf@news.euronet.nl>
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 |
Re: Footer & DOCTYPE
Steve Pugh <steve@pugh.net> 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 |
Re: Footer & DOCTYPE
In article <bqksrg$242nii$1@ID-16734.news.uni-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 |
Re: Footer & DOCTYPE
"Jukka K. Korpela" <jkorpela@cs.tut.fi> 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"? |
| All times are GMT. The time now is 09:30 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.