Toss out your Tables! CSS is the scene!
WEBINAR: On-demand webcast
How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >
There is, of course, one big argument against replacing tables with CSS divisions. How you phrase it depends on your ideology. Very old browsers support CSS poorly or not at all, so forgoing CSS in favor of the more backward-compatible tables is either:
- A. Accommodating the needs of those less fortunate, who don't have access to the latest browsers, or
- B. Pandering to an ever-smaller number of inexpert Web users who can't get it together to download and install a free piece of software.
These two viewpoints represent opposite sides in a debate that has recently become very lively — the question of adhering to current standards versus designing for backward compatibility. The CSS-versus-tables issue is not directly parallel, since there's nothing technically incorrect about using tables for positioning, but it is one of the fronts on which the standards-versus-compatibility war is being fought.
CSS is supported by Internet Explorer, Netscape Navigator and Mozilla, and Opera. Figuring out exactly what features are supported in which browser versions is an arcane subject indeed. The House of Style guide includes browser compatibility charts. For any given browser version (and there are often differences between Windows and Mac versions), there are features that work, features that don't, and others that work some of the time or in some weird way.
The position of what I call the "standards camp" is this: Most current browser versions support HTML 4.01 and CSS 2 pretty darn well (with certain notable exceptions), so let's start using these standards to their fullest, instead of being so obsessed with making our pages backward-compatible.
One of the torch bearers for this worldview is the Web Standards Project (WaSP), which describes itself as "a grassroots coalition fighting for standards on the Web." WaSP encourages developers to take advantage of current W3C standards "even if the resulting sites fail (or look less than optimal) in old, non- standards-compliant Web browsers."
These true believers point out that the more developers dumb down their code for the benefit of old browsers, the less incentive users have to upgrade. Instead of encouraging people to keep their old browsers, we should be encouraging them to grab a nice shiny new free copy of MSIE.
Predictably, some folks strongly disagree with this sort of thing. One member of the "compatibility party" points out that the Web is supposed to be a free-form, cross-platform, do-your- own-thing medium. What gives anyone the right to tell people what platform or browser version to use? However, newer standards such as HTML 4.01, CSS 2 and XML don't force anyone to use a particular platform — rather the opposite. The idea is simply to enforce standards so that everyone can talk to everyone else.
A more thought-provoking rebuttal came from a professional pundit, who pointed out that those nice new browsers come with hefty system requirements that many people in the world simply can't afford to meet. As the Web truly is a worldwide medium, this is something worth keeping in mind. Billions of potential Web users live in countries where cassette tapes are still the state of the art in stereo gear, and lots of people spend all day working with Pentiums running Windows 98.
The most compelling need to choose backward compatibility over current standards is felt by those selling products online, especially those brave souls who aren't targeting computer users per se. The mantra of the e-commerce crowd is Turn No Potential Customer Away. If you're a niche vendor running a mail-order business, then the danger of losing business among less sophisticated Web users may loom larger than the benefits of a standards-compliant Web site.
In the end, the choice is up to you, and you must make it based
on the goals of your site and the demographics of your
readership. In a
article, I explained how to analyze your server logs to
determine the mix of browser versions your visitors are using.
The higher the percentage of old clunkers in the mix, the more
incentive you have to stick with your old non-compliant, kludgy,
hard-to-edit (but it works) code.