64 Comments
- Grimdotdotdot, on 04/25/2008, -2/+24"Most developers dread dealing with HTML tables and cells to build their Web sites."
Um... No - that's the easy (but bad) way... - Grimdotdotdot, on 04/25/2008, -0/+15I'm sorry, but that article is properly rubbish.
I suspect foul play at getting it to the front page... - thetanbark, on 04/25/2008, -1/+15If you're still using Tables to format your websites, this article goes through the finer details of not only the how, but the WHY of creating div-based layouts. It also approaches things at a very beginner level, if you're anxious about learning a whole new development style.
But the PHP code presented is a disservice to the reader. They seem to assume you already know some PHP and what it can do, so they don't really explain that part of the code. It will function for this purpose, but isn't very secure, and would eventually be a nightmare to maintain. Instead of storing your data content in a file as the author suggests, it should go in a database.
This would have been a better article if he would have focused it strictly on XHTML/CSS templating and left out the clunky PHP parts. - loneBoat, on 04/25/2008, -2/+13Interesting point. You've changed the way I think about dynamic web-programming forever!
- LouisSlippers, on 04/25/2008, -2/+7If you dread building HTML tables you probably shouldnt be a developer.
"Um... No - that's the easy (but bad) way..."
This is not necessarily true. Using tables for layout = bad. Using tables to display date is highly recommended. - Matt2k, on 04/25/2008, -2/+6Because the point of being a semantic HTML + CSS developer is to do it the hard way and be snobbish about such things. Duh.
- magic6435, on 04/25/2008, -3/+7why the hell would i use tables to display the date?
- inactive, on 04/25/2008, -0/+4I work for a company that does just that. And it's WONDERFUL to know that the greasy nerds with penguins on their shirts can't (and in fact are not allowed) to touch the presentation layer. We use a simple templating system with only loop-logic and dumb tags. What is produced is valid XHTML and a zippy back-end. This method of working keeps everyone happy, and the geeks in the basement.
- Metasquares, on 04/25/2008, -0/+4And I bet you don't even notice!
- MRAS, on 04/25/2008, -0/+4The page was designed with tables...........
- petemorley, on 04/25/2008, -0/+4He means data. Tables should be used to display tabular data, not to layout a website.
- williamw83, on 04/25/2008, -0/+3The best line is "This code breaks every rule and best practice for HTML coding." Too bad there's so many sites and apps out there that have code just like that.
- DestroyFascism, on 04/25/2008, -1/+4php include (php.content_explanation.php)
if Include !=true {{
echo '$numbskulls' ; } else { echo 'Coffee_menu4article?'; }
endif ;
} - YodaJones, on 04/25/2008, -0/+3Let me guess who's in here.... Ummmm .NET coders?
- tubaros, on 04/25/2008, -4/+7All these IBM tutorials - you do know that just cos its got a Digg this button, doesnt mean you have to click it...
- Matt2k, on 04/25/2008, -3/+6Well, if everyone says it is bad, and the alternative is "clean" who can argue with that conclusive evidence like that? "It's only good for tabular data!", or any other time you have a multi-column layout, or complex grid requirements. Did you notice the IBM site that hosts this article was laid out with a table? Bet you didn't even notice the disturbing lack of accessibility and strictness!
Using CSSP to layout your site is fine, and in may places it makes sense, but to take it as an almost religious (and parroted) maxim is just absurd. A programmer is going to use a template to plug in pieces of their site anyway, and there is little advantage to retooling a multi-thousand line CSS file versus copy & pasting a block to another location and saving template2.php - thailand1972, on 04/25/2008, -0/+3"it sounds like a blind, unreasoned espousal of a position without true knowledge of why the position was taken"
So true. Like so many talking heads in the field of web design/development:- Copy the known, accepted way, even though you don't really understand it properly. Not that the "known" way is wrong, just people don't understand the concepts properly. - Kranklin, on 04/26/2008, -0/+2sigh. Say what you want, but when this whole use CSS only for layout BS came out, I gave it a shot and it caused me more headaches than ever. Even when you do use a "CSS only layout", you usually have to wrap you HTML tags and place them a certain way, which I don't think is semantic anyway. I think ultimately the best way to manage a large website which may need a template change from time to time is to use a good CMS such as Drupal or Joomla.
- Condemned, on 04/25/2008, -0/+2Haha, yeah.
If you don't do it their exact way, it's the wrong way. - DreadBlog, on 04/25/2008, -2/+4The writer of this article doesnt even know how to write xhtml properly. He put EVERYTHING in a div, including a paragraph. Buried for being clueless.
And as for using tables for layout, i couldnt even do that now, i've been doing it with css for so long that doing it using tables would feel restrictive and difficult. - Metasquares, on 04/25/2008, -1/+3The article descries tables but screws up the organization of the tags it attempts to replace them with. There is clearly a lack of independent thought on what constitutes "proper" markup - it sounds like a blind, unreasoned espousal of a position without true knowledge of why the position was taken. Buried for cluelessness.
- MacTyler, on 04/25/2008, -0/+2I really like what this tutorial accomplishes, but I see that many of you here say that this should be done with mySQL databases. Can you recommend me any tutorials that do this same type of example, but with the better method of doing things? Thanks
- gilzow, on 04/25/2008, -1/+3Anyone else notice that the author left a HUGE friggin XSS exploit in his example?
- RyanOC, on 04/25/2008, -4/+5Dammit I hate PHP!
- StandardsGuy, on 04/25/2008, -2/+3Couldn't believe this was published on 22 Apr 2008 - has it been in draft for a few years? Buried for non-semantic markup and CSS mostly but that's because the article is trying to cover too much really.
- david76, on 04/25/2008, -2/+3The examples given here are really bad.
DIV (php to insert text here) /DIV
Seriously, that's just horrible. Not at all semantic. Buried. - elbekko, on 04/25/2008, -3/+4Any proper web developer with experience will dread table-based layouts. They're not easier at all. Quite the contrary infact.
- vijayanand12003, on 02/15/2009, -0/+1you can get lots of templates here
http://bestwebsitetemplates.org - igmuska, on 04/29/2008, -0/+1What the deuce? IBM in the coding game...the article is just a rehash of all the same lame CSS Floating Div tuts out there right now. Since IBM wrote it, that must mean it's a good coding practice: that couldn't be farther from the truth. You can float just about anything but they never discuss that aspect, instead they sing "div this, div that, here a div, there a div, everywhere a div div, all night long div a div we go." hahahahahaha
PHP can easily do most of the layout code. JOOMLA!, Drupal and WP are PHP frameworks that could easily be taught to those that need a fast website and if in the right hands can be extended to include personalized layouts...but no, will they do that? Nope it is all about the cash, taking simplicity and making it overly complicated to keep the code to themselves, selling it to those willing to pay cash to some geek lost in his own megalomaniac fantasy of power...toast!
IBM is lame for even publishing this article, they should have at least used their own examples or at least discussed progressive enhancement or at least presented the best CSS layout practices, rather than using Zen Garden to make it look like they know something about CSS - Vagari, on 04/25/2008, -2/+3Woah... "divitis"
Buried for ignoring semantics. - MacTyler, on 04/25/2008, -2/+3Yes, because the phrase "you got to start somewhere" is a complete lie. And if someone has to learn how to do something, then they aren't going to ever be good at it.
- o0JoeCool0o, on 04/28/2008, -1/+1buried most developers use tables? Your mom does not count as a developer.
- o0JoeCool0o, on 04/28/2008, -1/+1hear hear!!
- jessehadden, on 04/25/2008, -3/+3XHTML? Not until it has major browser support without hacks. I'll stick with HTML 4.01 strict and CSS 2. And simply putting everything into div tags does not a semantic (X)HTML document make. The trick is to use the proper HTML tags to give your document meaning, so that things like web browsers and Googlebot can understand what you are getting at.
- darknailblue, on 04/25/2008, -2/+2Maybe... XML isn't always needed though. That's the thing. Plus it adds ANOTHER layer on top of the whole development life cycle. XML / XSLT are good for certain things - but what IBM is talking about is mainly doing templates for CMS based sites and in that situation XML / XSLT isn't a good idea. XML / XSLT would be GREAT though for formatting of homepage content especially when the homepage IMO offers a high-level view of the entire site.
- strictnein, on 04/25/2008, -2/+2Why?
- fr34k5h0w, on 04/25/2008, -2/+2If you are expecting a lot of traffic to be generated, use a caching mechanism or use a PHP framework with built-in caching such as Code Igniter (my personal favorite). It's better to plan for the worst and build your site from the ground up with robustness than to be freaking out when that one page gets Dugg.
- delorenj, on 04/25/2008, -2/+2Dugg for duh
- dbldwn, on 04/25/2008, -2/+2No. That's what cacheing is for. Returning a cached page may not require a database call every time, but that's where the data originates.
- webbunny, on 04/26/2008, -1/+1because instead of putting:
div p TEXT HERE /p /div
he put:
div id=paragraph TEXT HERE /div
A very odd way of doing it, and against the whole point of semantics... - kieranmaine, on 04/25/2008, -1/+1Is anyone going to explain why a paragraph can't go in a div? I'm talking about P tags btw.
- Smokersroom, on 04/25/2008, -2/+2When you sober up you'll realise you clicked on a dating advert by accident.
- Crath, on 04/25/2008, -7/+7if you don't do this kind of stuff already, you shouldn't be programming.
good programmers think of this stuff on their own - Grimdotdotdot, on 04/25/2008, -1/+1Ease up, man - I said 'bad' not 'should be struck down with super-AIDS'.
- kuseattle, on 04/25/2008, -1/+1Are you freaking kidding me! Buried for promoting newb programming and storing data in a file like it is 1999.
- omnidatacenter, on 04/25/2008, -4/+4Stupid...
- ardnut, on 04/25/2008, -1/+1*****
- kieranmaine, on 04/25/2008, -2/+1But its not the hard way. I always use divs to layout the areas of the site and then paragraphs are just used for text, which means paragraphs will be in divs.
- Smokersroom, on 04/25/2008, -2/+1Agreed.
- nexenator, on 04/27/2008, -1/+0You should check out http://istylr.com as it lets you "click-edit" table-less css designs onlive. It takes out a lot of hassle while dealing with "div's" and css and it even comes with built-in page-background and gradient creators.
-
Show 51 - 64 of 64 discussions

What is Digg?
The Digg Toolbar for Firefox lets you Digg, submit content, and keep track of Digg even when you're not on the Digg site. Download the official