View Full Version : DOCTYPE XHTML problem
emanuelle
08-06-2006, 08:06 PM
somehow this doctype does not support the 100% height I give to my main table.
I just wrote it like that
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
Any idea how to fix it?
mwinter
08-06-2006, 08:22 PM
somehow this doctype does not support the 100% height I give to my main table.
This isn't an issue that is restricted to XHTML; table elements don't have height attributes in HTML, either.
By the way, serving XHTML as HTML is pointless at best. If you are working with XML server-side, transform the output to HTML, first. If you are simply writing a document by hand, use HTML (HTML 4.01 Strict, preferably).
Any idea how to fix it?
Remove the height attribute, and use CSS, instead. However, note that percentage values used with the height property has limitations. The containing block (typically the parent element) must have an explicit height property, otherwise the value is considered to be the same as the value, auto.
Mike
emanuelle
08-06-2006, 09:52 PM
when I use HTML 4.01 Strict the height=100% in the table works.
I want the page to be 100% (height) and I have to use the XHTML doctype for further implementation.
boogyman
08-06-2006, 10:11 PM
1) It is always helpful if you leave a URL to your problem.
2) If your website is table based, then the default height is 100%. The only way it will be less then 100% is if you do not have enough content to fill the page to its base.
3) You should use the DOCTYPE to ensure the document is properly viewable to all standard compliant browsers eg.. just about all but IE :( HaHa
4)I would suggest you look into getting away from structuring your entire website without the dependency of tables. http://w3schools.org is a place you can get started on learning how to implement structuring based on "div"
jscheuer1
08-06-2006, 10:12 PM
when I use HTML 4.01 Strict the height=100% in the table works.
I want the page to be 100% (height) and I have to use the XHTML doctype for further implementation.
In which browsers? I have seen 100% height 'work' in a non-standards compliant browser like IE, sometimes. Usually it causes problems in all other browsers and often breaks down, when you least expect it, even in IE.
Oddly enough, sometimes the situation vis a vis browsers and 100% height gets reversed. In either case, having your page work in only some browsers isn't generally a good thing. There is almost always a better way to get the desired layout than height 100%.
mburt
08-06-2006, 10:13 PM
For it to be 100%, (as in: really 100%) the margins also have to be 0
<style type="text/css">
body {
margin:0px
}
</style>
:)
blm126
08-06-2006, 10:14 PM
pissa:Um..I think you mean w3schools.com
2) If your website is table based, then the default height is 100%. The only way it will be less then 100% is if you do not have enough content to fill the page to its base.Nonsense. The "default height" is the minimum possible whilst accommodating the content.
3) You should use the DOCTYPE to ensure the document is properly viewable to all standard compliant browsers eg.. just about all but IE :( HaHaS/he is using a DOCTYPE, as is clear from the title and post.
boogyman
08-07-2006, 12:00 AM
1) If the content is less then the viewed height, the table will not appear to be 100%.
2) Mike is correct about the margin rule...
table {
margin:0;
padding:0;
}
is the only true way of making a table 100% height... but that would also make it 100% width too...
margin-top 0;
margin-bottom: 0;
would make it 100% height then you could do whatever youw anted with the width
mburt
08-07-2006, 12:13 AM
(surfer-dude accent) Don't argue with the Twey, man.. Just be cool with whatever, dude.. :)
Lol, no, always argue with the Twey, dude. The Twey is like, always totally wrong, man.
jscheuer1
08-07-2006, 03:23 AM
Lol, no, always argue with the Twey, dude. The Twey is like, always totally wrong, man.
I must confess that I haven't been following this thread very closely but, when I saw this one (quoted) post, I had to laugh because of its humorous modesty.
The truth of the matter is that arguing with Twey will most likely result in your learning something, if he deigns to argue back.
I don't know what to say to that, really :)
I've been studying web design since just after the age most kids stopped playing with dolls, so I've got a fair collection of knowledge, but I frequently make daft mistakes, through inattention or somewhat vital gaps (which at the time, of course, I always firmly believe I don't have) in that knowledge, so you should never assume something's right just because I posted it.
mwinter, on the other hand, has been wrong a total of two times since I joined here. :)
jscheuer1
08-07-2006, 04:52 AM
I didn't say that you are always right, just that arguing with you is usually learning experience, if for no other reason, for me, than honing and organizing my thoughts on the particular matter but, it is usually more than that. Arguments like that are enjoyable.
I would dispute that error count on mwinter though. However, he is a very sharp cookie (pun intended but, not a very good one :) ) indeed! And the count is very low, in any case, I am sure.
I didn't say that you are always rightOh no, I didn't mean to suggest that you were. It was just the "humorous modesty" bit made it sound as if I was actually right a reasonable amount of times :p
just that arguing with you is usually learning experience, if for no other reason, for me, than honing and organizing my thoughts on the particular matter but, it is usually more than that. Arguments like that are enjoyable.Personally, I think that's a better thing than being always right. I've noticed that people who can hold a real, productive, enjoyable argument these days are rare, and I'm flattered you'd count me among them, even if I wouldn't always agree.
I would dispute that error count on mwinter though.Once he missed the identifier on a CSS block. I have a strong feeling that there was another time, too, but I can't remember what it was. I usually read any threads he's posted in just to see what information I can glean, so it's certainly not too wide of the mark.
mwinter
08-08-2006, 11:35 AM
I would dispute that error count on mwinter though.I would, too! ;)
Everyone makes mistakes, and I've made plenty. It's how we learn from them that matters.
Mike
jscheuer1
08-08-2006, 02:56 PM
Everyone makes mistakes . . . It's how we learn from them that matters.
That's 'my' Mike! A big Amen to that sentiment, brother!
True enough :)
Everyone makes mistakes, and I've made plenty.I think the operative condition was
since I joined here.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.