[UPHPU] More CSS frustration

John David Anderson uphpu at johndavidanderson.net
Wed Jan 17 13:55:25 MST 2007

On Jan 17, 2007, at 1:31 PM, Mac Newbold wrote:

> <snip>
> Did you notice that while the HTML is quite clean on these  
> examples, they don't even layout properly if you have javascript  
> turned off? The ones I pulled up use javascript to make the height  
> and width constraints on the divs match up from one to another. How  
> is that any less of a hack? That is not my idea of a robust way to  
> build a HTML/CSS page. Why should we need client-side scripting to  
> make our pages look right when they load?

I didn't. Bad example.

I suppose the prime layout example would be CSS Zen Garden, but I  
assumed that mentioning it was beating a dead horse.

> <snip>
> I could ask for a raise of hands of people who have had experiences  
> with CSS fragility in "pure css" layouts, but I don't want to flood  
> the mail server. Among people I've talked to, even the pure CSS  
> advocates admit quickly that there are some tricks (aka hacks) you  
> need to know before you'll have good results generally.

Table layout is 100% hack. Just because people have used it for a  
long time, it doesn't mean its not a hack. Using spacer images and  
farting around with cellpadding/width/alignment/borders is way more  
hacky than defining page definitions with CSS. Table layouts is a  
hacky workaround, utilizing the way browsers display tables.

> You can't really argue that the code I write (myself, or as part of  
> work with my coworkers) isn't at least as maintainable (to me/us at  
> least) as any code you could write your way.

I can give a visual facelift to my sites without changing the markup.  
A major overhaul might require the addition of some <img/div/span>  
tags. Pages created using tables for layouts are not this flexible in  

> When you write code for a living, or even as a hobby, isn't it  
> really about getting the most done in the shortest amount of time  
> over the long term?


> Quality of the code, including maintainablity, modularity,  
> separation, and any other good things, is something that heavily  
> contributes to time saved over the lifetime of the code. If I have  
> to invest 10 extra hours to a project to do it "ideally", then I'd  
> want to be pretty sure that it will save me 10 hours or more down  
> the road. If I'm spending time making code reusable that I won't  
> ever end up reusing, or making code more maintainable that I will  
> never look at again, what good does it do me? You're buying  
> something with your efforts that doesn't get you anything in  
> return. If it gives you satisfaction do to it that way, and that  
> satisfaction is worth the price you pay for it, that's great, but  
> that varies from person to person.

The reason I use CSS is because I've experienced the benefits you've  
mentioned time and time again. There's no drawback. The occasional  
CSS workaround is always better than table layouts, because table- 
layouts are 100% workaround.

-- John

More information about the UPHPU mailing list