Home > Uncategorised > I don’t get it

I don’t get it

OK, this is something that I just don’t get.

It was my understanding that XHTML 1.x STRICT was supposed to be just that – strict, and that all you were allowed to put in your XHTML file was the data and the tags that describe the rough positioning of that data, and that everything else should go into a style sheet.

So basically, rough presentation and data into XHTML; colours, fonts, background pictures, etc into CSS.

So why then does the <table> element still have the “border”, “cellpadding” and “cellspacing” attributes, even in the strict DTD type? Surely those are pieces of eye candy and should be rendered from the CSS file?

Don’t believe me? Then have a look at the XHTML 1.0 Strict DTD, and search for “cellpadding” – it’s certainly in there under the “table” element.

I even checked against the XHTML 1.1 Strict standard, and these attributes are not listed as having changed (I couldn’t see to find a reference to them in the DTD on that page, but there are listed in the modularised DTD for tables here).

Can someone explain this, or is this just some piece of random thinking that slipped the net?

P.S. Found this out from here.

Categories: Uncategorised Tags: , ,
  1. Rich
    May 7th, 2005 at 06:07 | #1

    Yup
    You’re right — putting a table with cellpadding into my XHTML1.1 Strict page validates.

    The reasoning is that tables are inherently a visual specification. Table headers are centred, rows always appear above each other, etc. Thus it’s OK to somewhat merge layout and presentation. Contrast this with a DIV, which is a semantic element — “these elements are conceptually related”.

    CSS2 has its own table specification: http://www.w3.org/TR/CSS2/tables.html.

  1. No trackbacks yet.