The first Web pages on the Internet contained little more than text and hyperlinks. As the Internet's popularity grew, however, Web design outgrew the current HTML standards and the capabilities of available browsers. Designers needed a way to create complicated Web designs that Internet Explorer and Netscape browsers would display the same way. Out of this need came table-based design, in which designers used HTML table tags -- meant for displaying tabular data -- to create the structure for a site's design. Since around 2002, however, Web professionals began considering table-based layouts as a poor coding technique.
Background
Early in 2001, the influential online publication A List Apart published an article titled "From Table Hacks to CSS Layout," which sparked a heated debate among Web designers. Many designers and programmers were reluctant to stop using tried-and-true table-based designs. In 2001, browser support for CSS (Cascading Style Sheets) was limited. Internet Explorer 6 was released the same year and had the best CSS support for its time, but that support included many bugs. The most infamous IE6 bugs -- the "box model bug" and "double margin bug" -- wreaked havoc on otherwise well-coded CSS-based layouts. For these reasons, it took a few years for designers to drop table-based coding for CSS-based coding.
How Table Layouts Work
Table layouts use HTML table tags to create a structure for the site's graphics and contents. The classic example is of a three-column layout with a heading and footer. In a table-based layout, designers use HTML tags to create a table with a two-column-wide cell on the top and bottom rows. The table's middle row contains three cells, and each cell is a column for the site. Attributes that are no longer used in HTML 4 and up allowed programmers to control spacing, padding, width and height of table cells.
How CSS Layouts Work
Layouts controlled by CSS properly separate content from presentation. This means that the HTML file contains the content -- text, images, etc. -- while the CSS defines where that content appears on the page. Designers can link one CSS file to every page in the site and, as a result, be able to change the whole site's design by changing that one CSS file. The standard CSS replacement for table tags in HTML 4 and XHTML is the