While historically tables were faster than div+css layouts, the performance reasons for using one over the other have become negligible with current browsers.
There used to be a noticeable difference in speed, especially in IE6 with larger tables and numerous floating div tags. However, as browsers evolved and optimized their rendering engines, the gap closed. The transition from tables to floating divs on certain websites was once easily detectable due to the underlying code running more efficiently. But now, with modern web standards and browser capabilities, the choice between tables and div+css is less about performance and more about appropriate usage.
Despite this shift, there are still valid reasons to consider when deciding between tables and div+css:
- The W3C standards do not necessarily advocate for replacing tables entirely with div+css. There's an emphasis on separating structure from style, which can sometimes be better achieved with tables.
- Tables offer a more predictable selection behavior compared to div+css layouts, especially when working with tabular data.
- Tables are easier to work with for non-browser applications like Excel where data may need to be copied or pasted accurately.
- Using tables can simplify CSS styling since much of the formatting is predefined within the table itself.
In the end, it's important to choose the most appropriate element for the specific task at hand. While the W3C guidelines discourage using tables for layout purposes, they acknowledge that there are exceptions where tables may still be beneficial.
It's worth noting that according to the W3C HTML5 standard, tables should primarily be used for displaying tabular data rather than for layout design.
Proper understanding and implementation of HTML elements, including tables, is essential for maintaining consistent accessibility and usability across various platforms.
Update 2012/03/12: Additional information and references to valid standards have been included to clarify the appropriate use cases for tables.