Previous Message
Next Message

Table hysteria?

Sent by Sebastian Redl on 12 December 2004 14:02


Bob McClelland wrote:

> <>Hi Frank, and all,
>
> Whilst I am all for CSS and standards and deplore the heavily nested table
> stuff, it does sound, on occasions, as though the new evangelists are
> becoming neurotic ("gosh! no - I <strong>can't<strong> use a table" is a
> cry often heard) and I really think there is a flaw in the argument that
> "tables are presentational".
>
I've never heard this argument. Tables are semantic, and that's exactly
the problem. Table-based layouts ignore the semantic meaning of tables
(that the data in it is organized into rows and columns, and is
therefore somehow related) and use them for presentational means.

> <>If you look at:
>
> http://www.treyarnon.fsworld.co.uk/tabletest.html
>
> You will see the same text a) presented in a simple table and b) presented
> in divs. (The divs have no css, the table does). If you view the page
> without styles, you will see that both are absolutely identical. The
> conclusion is either: 1) Tables aren't 'presentational 'or 2) divs 
> ARE! :-)

Since what you have in the table is not tabular data, you have used
tables for presentation, which is exactly the problem.

> <>OK, I'm going over the top here, for effect, but the only difference 
> between
> tables and divs seems to be that tables are supposed to be for 'data',
> according to W3C specs.

Divs are for data, too. Divs are to introduce structure in the document
that has no explicitely defined semantic elements. For example, I am
writing a C++ tutorial and publishing it online. There, I have every
block of text wrapped in a div. I'm effectively using the div to div-ide
(div stands for division) my document into sections, as is the section
element of XHTML 2 supposed to do. (I'm even using my headings for that
very effect.) My divs introduce structure, which I later use for
attaching styles to the document.
Tables are for tabular data, though, and this is a subset of data. What
is put into tables in table-based layout is not tabular data, which is
why it is a presentational misuse of tables, just like using blockquotes
for indenting was a presentational misuse of a semantic element.

> <>My conclusion is that, if you are really struggling, a table can 
> sometimes
> get you out of a mess (as with equal length divs, expanding to the content
> of one of them, e.g.) - more to the point, it isn't such a terrible sin to
> do that as some folk would have you believe. IS it?

That depends on where your focus lies. Zeldman has an entire section in
his book "Desiging with Web Standards" devoted to Transitional Layouts,
which use one or two tables to structure the page into columns. It can
make designing a lot easier, far easier, in fact, than pure table
layouts. But they don't have the full advantages of pure CSS layout,
which are arbitraray restructuring, completely dynamically switchable
style sheets, and all the accessibility and semantic advantages of
clear HTML.

Sebastian Redl

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: