views:

194

answers:

10

Should I teach CSS layout directly to new learners or should I first teach how to make layout with tables, then div+CSS?

And what should I teach between HTML or XHTML? Both are same so should I start directly with XHTML 1.0 Strict?

+13  A: 

You should teach them to use CSS for layout and tables for tabular data. They will figure out that they can (mis)use tables for layout all by themselves.

RegDwight
I did my resume in 1994 (HTML 1.0) using tables for the layout, and it was almost indistinguishable from the one done in Word even when printed from Mosaic. Needless to say I don't consider it misuse. Suboptimal for many things sure.
phkahler
It wasn't misuse in 1994 because there weren't alternatives. Now we have CSS.
Thom Smith
+1  A: 

I would start with non-tables, why teach what's going further out the door?

Also I'd go with the HTML 4/5, XHTML is abandoned at this point...that's not to say it's not used, but the next few years are moving to HTML5, not XHTML.

Nick Craver
I disagree, XHTML is close enough that it still is widely used. Just because ppl are getting lazy and only writing half a doctype doesnt make the rest of the site html5.
Moshe
@Moshe: I am not disagreeing that it's used, I'm saying the spec is no longer maintained or advanced by the W3C, all effort is going into HTML5. Given modern browsers already support a good deal of this, it's a better direction for **new** learners. If you're using XHTML now I wouldn't abandon it, I'm actually using XMHTL 1.0 Transitional on a project this moment.
Nick Craver
"... the W3C, all effort is going into HTML5" - which includes XHTML5.
Alohci
Why teach HTML5 when the spec isn't even complete yet?
ILMV
@Alohsi: These are 2 different things, one's a variant, see the answers here for a good discussion on it: http://stackoverflow.com/questions/256953/html-5-versus-xhtml-1-0-transitional
Nick Craver
@ILMV: The spec isn't changing, not for what you'd teach a beginner. An anchor is still an anchor, HTML5 is mostly HTML4, that's what you're teaching/going towards. XHTML has much stricter rules and it is a different thing to learn, a looser set of rules is a bit more productive when learning. Teaching a new guy XHTML 1 when he moving later to HTML5 seems like a waste when HTML 4 -> HTML 5 is a much more productive use of time.
Nick Craver
@Nick Craver - No HTML5 is not like that. HTML5 - the draft specification - defines two serializations. They are an HTML serialization and an XHTML serialization. The serializations have equal standing within the HTML5 spec. The spec and the HTML serialization used to have subtly different names, although the difference was too subtle, so it was dropped. Now, one just has to be clear about whether one is talking about the spec or the serialization. Either way XHTML is far from abandoned.
Alohci
@Alohci To clarify, you have to look at comments in the context of the question. He's referring specifically to `XHTML 1.0 Strict`, this is what I meant as being abandoned. I agree XHTML isn't going anywhere, just that the 1.0 Strict version isn't being used much, and teaching anything specific to it (over transitional) would be much better spent on X/HTML 5.
Nick Craver
+1  A: 

i'll speak from a perspective of a really inexperienced person when it comes to layout design...

so, in old days it was all html tables and although at times cumbersome to get what you want, but at least it was logical.

then i read all about the 'correct way of doing things' ie how css can save the world. and got lost, may be it's me, but getting something trivial done always takes lots of fiddling with css and really a huge amount of guesswork and trial and error. now i must admit i haven't spent lot of time figuring out css, but it seems a lot less intuitive than table layout.

so. i would suggest you start with css layout and i trust your students can get it right. when they are comfortable with that, introduce table layout. if you do other way round you will confuse them (or at least i'm confused and still trying to apply same patterns to css, which obviously doesn't work)

pulegium
+1  A: 

Don't teach them tables!!

And teach them xHtml, it is more structured and they will understand the syntax better.

Martin
A: 

If you start it wrong, don't expect it to be naturally fixed later (with the level of careless laziness we deal with in the web industry).

How about first you teach them accessibility and how a table in the layout will asplode any screen reader, then you don't have to justify why tables would be easier.

F.Aquino
A: 

Iam teaching some people html design in our company. The best way till now was to start with clean xhtml 1.0, than add some styles with css, than start to add divs with floating and such things.

Later show them how easy it is to create an 3 column layout with one of the popluar css frameworks like Bluetrip oder grid960.gs. I think there is NO reasons to teach design with tables (only if you use css3 and the new table styles).

ArneRie
+4  A: 

You should teach CSS directly.

More importantly than "doing layouts" they need to understand the Separation Of Layers: Content, Presentation, And Behavior. As soon as you teach them the better.

If you're concerned about CSS complexity, just do simple exercises. About XHTML of HTML, choose one to teach, stick to it and after they are confortable with you say there are alternatives. IMHO, I would choose HTML though.

GmonC
+2  A: 

Better teach css layout first. Tables are too easy - if they learn tables first, and then switch to css, they will wonder why you are telling them to use a system which requires hacks and tricks to work in different browsers, and to get the same-height columns and flexible widths that you get free with tables.

Ray
A: 

Whilst we all hate tables for layouts I think it's important to introduce them to the concept so they can understand exactly how important CSS is.

I would also suggest teaching them XHTML instead of HTML5, sure you can perhaps do a session on what HTML5 might be like when it's finally completed, but it's pointless doing this when it's so young, wait until they understand XHTML first.

ILMV
“you can perhaps do a session on what HTML5 might be like when it's finally completed, but it's pointless doing this when it's so young” — HTML5 isn’t one thing, it’s a collection of features, some of which are implemented now. See http://wiki.whatwg.org/wiki/FAQ#When_will_HTML5_be_finished.3F
Paul D. Waite
A: 

HTML or XHTML?

HTML and XHTML are the same language (i.e. the same tags, with the same meaning), just with slightly different syntaxes. If you know HTML, you know XHTML. In terms of learning, there’s no appreciable difference between them.

The difference between HTML 4 and HTML5 is greater than the difference between HTML 4 and XHTML 1.

Paul D. Waite