HTML/Tables: My table is on strike!
Asked by
klaas4 (
2194)
November 11th, 2008
http://school.daveyyzermans.nl/levensbeschouwing/jodendom/
Working on a little project for school here about WW2, the Jews in particular, but I have a problem. See, my table has always got to be 100% in height, even with a small text, so I build in a small ‘egg’ to test it. When you click the 2nd paragraph of the text (Mauris nibh mi…) the text but the 1st paragraph will diseappear, so I can look if the table’s still stretched out.
But when I do this in IE, the header suddenly measures 50% in height, in place of the 37px as stated in the holy stylesheet. Is my IE on strike against the holy stylesheet?!
I think it’ll be another small fix (like this) but I can’t find it. Hope you can! :)
Thanks in advance!
Davey.
Observing members:
0
Composing members:
0
4 Answers
There’s no need to be using tables in that design. Tables for layout is bad practice. Also, wrapping p elements in a span is invalid html.. Inline elements should never contain block elements – only other inline elements. That could be causing issues with IE. Not too sure in this case, to be honest.. It’s been years since I’ve tried to use a table like that!
I hacked up a tableless version for you. It is a little different but you can tweak it if you want. It is pretty straightforward. And for simplicity the CSS is in the head section. It is here.
It is kinda sloppy but it is free.
Yeah, I sorta expected this answer. The reason I turned to tables is that I tried div’s first, but it didn’t work, so I turned to tables. Also it’s a school project, so no one’s gonna validate my code. :)
Thanks again for the code, John. Works like a charm. I’m going to study hard to find the key. Maybe I could use this in later designs, you know.
Davey.
Sorry; I wasn’t trying to be rude.. I know it’s just for a school project, but invalid code often leads to display bugs. If you’re wanting to improve your HTML skills, you should try to make a habit of validating your code, even if it’s just for a school project or some proof-of-concept site which you’re never going to upload – you’ll learn a lot about what you can and can’t do within different doctypes and how to write better HTML.
In the case of the html you’ve written, looking at the errors, it’s got 14 counts of it not being happy that a p element is within a span. All you’d need to do to get that page to be valid is to switch the span to a div (spans and divs are essentially the same thing, except span is inline, div is block).
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.