programming development hire chicago

Cross browser compatibility

Tables and styling

HTML tables war

HTML tables are now the focus of yet another push to remove technologies before newer ones have become established. It is possible to code an entire website without using them. Indeed some people have an aversion to tables altogether. However if you want some of the older browsers to be able to render your website you might well want to rethink whether its a good idea to remove one of the most powerful elements that HTML has to offer. Tables for tabular data should be a web developers mantra.

There is also a lot of talk about table deprecation. As of HTML 5.0 tables for display are being deprecated. However, tables themselves are NOT being deprecated. This is not very surprising as tables are very useful when displaying data and always will be. You can expect the usual styling tricks that are currently applied to tables to be applied to the new set of tags in HTML5. There are also rumours that XHTML is about to be replaced by XML. XML is generally used more as a protocol between different applications and is likely to continue to be used in this manner.

I have even seen the entire HTML DTD and schema copied and pasted and the classes for tables renamed to something different then applied to an XML document. If you want browser compatibility issues to haunt you, this is the way to go about it. Web browsers will also continue to support tables in whatever form they are used. Just use a little discretion and everything will be fine.

The W3c has this to say about tables

"Contexts in which this element may be used: Where flow content is expected."

WC3 logo

"As a general rule, elements whose content model allows any flow content should have either at least one descendant text node that is not inter-element white space, or at least one descendant element node that is embedded content. For the purposes of this requirement, del elements and their descendants must not be counted as contributing to the ancestors of the del element."

"This requirement is not a hard requirement, however, as there are many cases where an element can be empty legitimately, for example when it is used as a placeholder which will later be filled in by a script, or when the element is part of a template and would on most pages be filled in but on some pages is not relevant."

Once again I could put it a little simpler. Tables are for tabular data. Take a look at some websites. You might well find that there is a lot of tabular data bouncing around out there.

duracell bunny

I would say that once again a balance needs to be struck between accessibility issues caused by the overuse of tables and issues of browser backwards compatibility as a result of the use of CSS to render all content. Surely common sense must be applied to web development styling issues when considering rendering options. I myself prefer hybrid websites utilizing both tables and CSS. Throw in some gracefully degrading JavaScript and you might find that you end up with websites that will go on and on just like the Duracell bunny.

<< Previous Page | Next Page > >

Article by J C Green

This article was written for non-profit educational purposes. Comments? Suggestions? Rants or raves? E-mail me using the form on this website.