HTML purists (& the W3C) frown upon using html tables to achieve page layout & design. However, the layout power of a table has been exploited since the 1990's to create visually interesting page designs. CSS was supposed to free us from the inappropriate use of html for layout. But, CSS has it's limitations.
Comparison
This section added 2004-05-23 (May 23, 2004).
Tables and CSS are different. They are different tools, suited for different tasks. Learn to use them appropriately.
Tables |
CSS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
From Tables to CSS; standard problems
Since the 1990's, web designers (professional, and amateur alike) have been using html tables & nesting tables inside tables to position graphical and content elements on a web page. How else could you have a 3-column text layout, and position bits of graphics around text?
Cascading Style Sheets (CSS) are supposed to allow us to do what html was intended for: separate content (html) from format (style). The standards intelligently designed by the W3C are elegant and powerful. Unfortunately, they were not truly standard when first written, as many browsers did not support the full CSS specification. For more info, see the WaSP for a slightly longer description of the problem with web "standards".
So, where does that leave the amateur web designer? I still need to make a page, and I have creative energy to channel into my page design. What should I use, tables or CSS? Well, I recognize the benefits of using CSS and have decided to switch over. I really like the power of the standard, and the benefits, so I have decided to use it. After many hours of frustration, I have developed an approach to limit the browser bugs I need to address. Older browsers may see my pages as boring, without any CSS layout, but at least they are readable. Such pages are also more accessible to screen readers and people using other special software to help overcome visual impairements, faster to download (without extra code & spacer graphics), and easier to maintain and manage content. For other benefits, see the W3C.
I think it's absurd (but understandable) that html elements like tables are more stable & widely supported than CSS layout tools. CSS may simply be too new to become well established in browsers, but a standard is necessary to make web design practical. Standards mean I don't have to test or write special workarounds for separate browsers that read the same code in different ways.
The W3C and html purists frown on using tables to achieve layout for an entire page. They were intended to display tabular data. I've read many articles online re-enforcing this notion, so I decided to abandon the table for page layout. Unfortunately, this has meant that it takes me significantly longer to design a page, because I have to test CSS code and sift through lots of code to fix bugs, and test on a few platforms. But, I end up with a very flexible design, and pages that are sematically and structurally sound (and valid!). However, I have often wondered if having a "valid" document & CSS is worth all the extra time, when it ultimately results in pages that are less exciting on older browsers, and all the extra time & frustration it takes.
I have committed to an approach of separate content from style, because I believe it makes more sense from the perspective
of publishing documents for others to view. HTML (or XHTML,
see the W3C for more info) and CSS
are a powerful combination allowing the same content to be displayed in a dynamic fashion, in different media types. CSS negotiates
between the designer's intent, and the needs of the user. For example, some users need larger text to read - CSS allows the
user to override the designer's format to allow one that is more accessible to the user's needs. This is why the <font>
tag is so dangerous in html; not only is it not a real html tag (it's an extension supported by many browsers), but it does
not allow the user a say as to what the browser will do with it, unlike CSS. There is really no good reason to use the<font>
tag, since CSS is a much better way to format text and is generally much better supported in this respect. On the other hand,
layout is another story altogether!
The right tool for the job
The internet (specifically, the World Wide Web) has evolved to be quite different than what was originally envisioned. It has become a powerhouse of marketing and business enterprise. At least, in developed countries. Anyway, the point is that the internet is no longer simply a tool to post documents to read. It is used by companies to sell things, manage information, and run "internet applications". In this setting, it seems to me that content can not be easily separated from format. In many respects, the two are very much inter-dependent, such as from a marketing perspective, or when designing an internet application. In this case, it does make sense to me to use a table, or other html markup to rigidly structure the layout of a page. The layout and style of these pages need to be stable across many different platforms, or the content will be lost. In this setting, pages are no longer simply documents to be posted for others to read - they are locations where users can interact with the content. And the content includes the graphics, layout, and formatting of every pixel in the browser window.
Conclusion
My conclusion is that if you want to use the internet to sell things, or to create a visual environment that is stable across multiple platforms & user agents, using tables for layout makes a lot of sense. It just means people with visual problems may have problems getting your message. But, this is a relatively small sector of the market for most businesses, and there are other alternatives for accessibility. If you want interactivity, that's what flash is for (or other technologies). But, if you want to publish documents, the W3C standards model of XHTML & CSS is a powerful combination. Perhaps what this eludes to is a need for the world wide web technology itself to change into a structure that is more suitable to interaction among users, and between users and their content. But the task of designing the future of the internet I leave to the professionals, and the needs of the users. I pray that it is not dictated to us by Microsoft.
No comments:
Post a Comment