Sunday, September 11, 2005

Feeling the pain of XHTML

Dimitris Giannitsaros, a fellow microISV blogger, made a post about how much of a pain a "tableless" HTML/CSS design can be.

Back in 2003, I became really good with CSS. I read all the CSS blogs. Zeldman, Simplebits, mezzoblue, meyerweb, etc.... I took all of that knowledge and built the current version of michaelsica.com. See my first blog post, from my old blog. (This blog is a sub directory of that site, and uses a Blogger template.)

After I built my site in XHTML and CSS I thought those two technologies were the only way to go when building a layout. Tables were to ONLY be used for tabular data. CSS-P (CSS Positioning) was the only way to go.

I believed that until I started in on the XHTML version of Ataraxis Unity™. (I've since dropped the XHTML version in favor of OpenLaszlo/Flash. But the original design was in XHMTL.) I remember the first time I started to hate CSS-P. I was trying to get (what I call) the icon bar of Ataraxis Unity™™ to look a certain way. I spent an entire night fighting with XHTML/CSS to get it to do what I wanted in all the browsers. And honestly, I never got it exactly how I wanted. The next night I worked on my design and I got what I wanted out of tables in less than an hour. It might have even been about 15 minutes. And I was really good with XHTML and CSS.

I'm not arguing against XHTML and CSS. For most content-heavy web sites you're going to want to use those technologies. They do a lot of amazing things.

My suggestion to everyone making a web application with XHTML and CSS-P is.... If something is taking you too long, stop. Think about why you are trying to reach the utopian goal of, "We only use CSS-P. Tables are not allowed in the layout!" If the answers you can come up with are:

1) "I'll be able to completely re-do my layout using CSS-P easier than I could with tables."

and

2) "I'll be able to offer multiple views for different devices with the same markup."

Stop lying to yourself. It's not that easy!

(1) You can easily redo layouts with server-side code. We've all done it. It's not that hard.

(2) That's not a good idea. You'll have to build the markup to take into account the lowest common dominator for all these varying "views" you plan on offering. I believe you can offer a much better user-interface if you purpose build the interface for the device/platform/view you chose to support. If your application is built with the appropriate abstractions and layers than building a different view and making use of the same business logic isn't very difficult!

Please read this next part carefully...

I'm not saying to ditch XHTML/CSS or even the use of CSS-P where it's the best choice. For your own sake, use what works in an intelligent fashion. Just remember... nothing can be perfect. Use what works. Time is money. You've got to ship your app. (And so do I for that matter!)

1 Comments:

Blogger Dimitris Giannitsaros said...

Nice post...

On the other hand I've also hated some heavy table designs (tables inside (tables inside (tables inside (tables...))))

I guess the best solution lies somewhere in between full table / full css designs.

Sunday, September 11, 2005 3:11:00 PM  

Post a Comment

<< Home