Browsing the ‘Random Thoughts’ Category

The definitive answer to using tables for layout    December 23rd, 2008 at 8:35 pm

I’m way too busy for a post with actual content however I had to share this. This is the definitive answer to when its ok to use tables for layout.

http://shouldiusetablesforlayout.com

Merry Christmas!

Posted in Random Thoughts, Uncategorized | No Comments »

Valid, Semantic HTML and CSS does matter.    September 7th, 2008 at 11:27 am

w3c logo Its an old argument, table layout vs. CSS. Add to that the question of, “does it really matter if my website ia valid?”. The short answer is yes it certainly does matter!

During the original mockup or design phase it might seem easier to use tables. Most of the time you can get tables to render appropriately acrosss all browsers. You fired up your dreamweaver or front page (eeeeek) and pounding away at your table layout adding background images to the table rows and cells and the nested table within table, within table. If you have a good eye it probably looks great! Of course the source code is a little iffy and your eiditor added inline styles to nested tables. But the site looks great and you put it together in record time because you are a front page guru.

Its a pretty basic static site but there are great plans for it in the future and of course it will be the next “big thing’. Six months later its time to expand the site, add more pages, dynamic content, database integration oh and maybe you’ll put in some more flash (because everyone loves flash). You take the website to a developer and he either gives you an astronomical quote with long production time or maybe he is all of a sudden too busy to get to your project. Some times, “too busy” means I don’t want to touch this mess. Its our easy button.

The truth is your website has either gotten to a point where it needs to be re written or your going to dig yourself into an even bigger hole that costs you allot more money than it should of in the first place.

Case in point I was working on a project a couple weeks ago with a few other developers. To their credit none of them are responsible for the mess that is this site. But they have been tasked with fixing it. I had a few minutes and asked if there was something I could help with. One of the nested tables somewhere in the 600 lines of markup didn’t get closed. It was my job to find it.

The site is a beautiful site but my heart sank when I saw the nested tables and inline CSS inside the table cells. Oh and it had 5 sytlesheets. Normally the easiest way to fix this problem is to run it through a HTML validator and it will tell you where the problem is. Even if a site isn’t valid you can usually fix the errors and eventually get to your problem in short order. Then I saw this.

incalid

Fixing the 100 errors just to find the problem was not a viable option. Even if most of the errors were unclosed tags, missing alt image tags it was just too much. So I resorted to going through every line of code looking for the culprit that was throwing off the table layout on this one page. Total time 2 hours. If it would of at least validated in the first place this could of been fixed in 10 minutes.

Bottom line is you should care if your website has nested tables and invalid markup because it will cost you more money to fix later. If you go to a developer or two and they say, “it needs to be written over” you should listen. Sometimes you just need a good do over to get rid of all the quick fixes that have made your site impossible to maintain.

Posted in Random Thoughts | No Comments »