W3C home > Mailing lists > Public > public-html-comments@w3.org > July 2012

Re: Some advices for table, th and td elements

From: Jukka K. Korpela <jukka.k.korpela@kolumbus.fi>
Date: Thu, 12 Jul 2012 11:48:46 +0300
Message-ID: <4FFE8F6E.50704@kolumbus.fi>
To: River John <r0011cn@gmail.com>
CC: public-html-comments@w3.org
2012-07-11 12:49, River John wrote:
> I think that the "width" attribute for td, th and table elements is 
> very useful, and should not be as the attributes that will "Not 
> supported in HTML5".

It is presentational, and the policy is to declare such attribute as 
obsolete, see
http://www.whatwg.org/specs/web-apps/current-work/multipage/introduction.html#presentational-markup,

Not everyone agrees with this ideology - and none of the reasons listed 
in the cited document really applies to the case you describe, or many 
other cases -, but I think it's unrealistic to try to change it now, 
unless you can come up with *very* strong arguments about some special 
cases.

Note that the attribute is declared obsolete but still to remain in the 
spec, with description of its meaning, and browsers are required to 
support it, and will undoubtedly do so; see
http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#conformance-classes

The only real problem, to people who wish to keep using presentational 
attributes, is that conformance checkers will issue error messages. This 
can make it more difficult to distinguish real errors from a long list 
of messages. But I suppose someone will some day create a conformance 
checker that has the option of switching off the "ideological" 
messages.The benefits to do this:
>
> 1. We can specify the width of columns in a table immediately and simply.
>
> 2. Need not write CSS for each table and each column.
>
> 3. Need not add the class attributes to these elements in order to 
> applying the CSS
>
>
Considering some old browsers, it is true that class attributes would be 
needed in some situations, but nowadays support to selectors like 
:nth-child(...) are rather widespread. You may still need to use id or 
class attributes for <table> elements to have different styling for 
different tables, unless you prefer using style="..." attributes.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/
Received on Thursday, 12 July 2012 08:49:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 12 July 2012 08:49:17 GMT