Wednesday, February 08, 2006

tables vs css for html formatting

tables as layout devices are bad becase they confuse content and presentation in a document. they were originally designed to display tabular data (charts, tables, etc) in orderly ways, and their use as layout tools is essentially a hack dating back to the earlier browsers. what happens when you use a table to create the presentational aspects of your page is that you divide the content into chunks based not on what the chunks mean or their function in the document, but instead based on visual characteristics. this makes it difficult for non-traditional devices such as screen readers for the blind or web-enabled phones to display or render your site in any meaningful way. it's better to use CSS for visual presentation because it allows non-traditional devices to make sense of your page and reinterpret it based on the needs of the end-user. it also allows you to create context sensitive versions of a document with a single set of markup (ie, making print-friendly or WAP-friendly style sheets for one single html document).

there's plenty of other reasons, but basically: you're sacrificing the flexibility and accessibility of your document by using tables as a presentational device. Link

0 Comments:

Post a Comment

<< Home