Assistive technology gags when it encounters HTML tables coded by the old school methods. Using the new coding lets you make tables more accessible to your users, and it really isn't that much harder--just remember what a table really is. Chris Heilmann reminds us, and gives an introduction to CSS.
HTML, CSS and Tables: The Beauty of Data - Embracing CSS and separating "what is what" and "what it looks like" (Page 6 of 7 )
With MSIE6 and Gecko being released, we are able to completely separate the HTML markup and the presentation.
Instead of repeating the visual information or use a lot of classes in each HTML document, we create a roughly 700 bytes big CSS file and apply it to each of the documents. Instead of classes, we use the element names and use descendant selectors. Changes are done in the CSS exclusively. Removing the classes cuts down our table to 1.3KB and 30 lines of markup.
Creating the desired "hairline" effect of our table requires some CSS skill. A quite robust way of doing it is to define a border on the left and the top for the table, and a border on the right and the bottom for the inner elements like cells and headers in our CSS.
However, to ensure that our lines meet, we need to set the cellspacing attribute in our HTML to 0, and cellspacing is a deprecated attribute for XHTML.
For XHTML documents we can use the border-collapse selector in the CSS to achieve the effect.
Lets take a look, shall we?
Our markup:
<table summary="This table lists all the flights by XYZ Air leaving London today."> <caption>Flight Schedule</caption> <thead> <tr>