Electric Type

Multimedia

About Us

News

Help

Lean and Mean Tables
by Steve Mulder 30 Oct 1998

Steve Mulder is manager of information architecture in the user experience group of Terra Lycos, where he wears as many hats as possible. He pretends to know a lot about design strategy, interaction design, usability, writing for the Web, and Web development.

Page 1

Welcome back. In Part 1, I discussed how to speed up the loading of your HTML files by getting rid of extraneous code. This time around I'll focus on one of the worst culprits for fatty HTML, our good friend the table. As we all know, tables are wondrous for controlling overall page layout. Without them, our designs would be ... well ... prehistoric.

But using tables comes at a price. They generate a ridiculous amount of HTML code: TRs, TDs, ALIGNs, CELLPADDINGs, and on and on. Fortunately, there are ways to beat the system and minimize table code.

The first trick: Don't use tables unless they're absolutely necessary. I know that sounds obvious, but there are many sites that don't follow this simple rule of thumb. For example, if all you want to do is left-align an image and a caption on a page, there's no need to use a table at all. Also, just because some elements on a page are layed out using a table doesn't mean the whole page needs to be. Take a look at the following fake page:

(The gray lines represent text, and the colored rectangles are images.)

To create this page, you'd have to use an HTML table - at least for the columns of text. But you wouldn't need to put all the page elements within table cells. Shown below is the same page with table cells in red:

Note that the blue banner graphic at the top of the page doesn't need to be in the table, nor do the text line and yellow graphic at the bottom.

Now let's move on to liposuctioning all those extra table cells.

next page»


Dynamic HTML  

Frames  

HTML Basics  

Stylesheets  

Tables  

XML  

Javascript  

Database Connections  

Intro To Perl  

HTML 4.0  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.