Query: HTML table summary attribute

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Query: HTML table summary attribute

William Ingram
I've just run TIDY on an HTML file of mine, and it alerts me that I should use the table summary attribute.. But this attribute is not supported in HTML 5.  So should I or shouldn't I?

William Ingram


Reply | Threaded
Open this post in threaded view
|

Re: Query: HTML table summary attribute

Geoff McLane
Hi William,

What version of tidy are you running?

Where did you get the binary from? A download, or
did you build it from source? What OS?

What do you see when adding the command --version

The current version, from the htacg source -
  https://github.com/htacg/tidy-html5
is 4.9.26...

At present tidy5, and for quite some time now, no longer
emits this warning in /ANY/ case, which may be fine for
html5 mode...

But conversely, perhaps a bug, if the document /IS/ html5,
and you /DO/ add a summary attribute, tidy5 does /NOT/ warn
that the summary attribute is not supported in HTML5 ;=((

Further, another possible bug is that even if the doctype declares
the document as an earlier doctype, like say 4.01 strict, or
transitional, tidy5 still does not emit the warning ;=((

It may be worth raising an issue for these...
  https://github.com/htacg/tidy-html5/issues

In fact, checking the current code, in CheckTABLE(),
the code to check if a 'summary' is present has been
removed! It was REMOVED back on Nov 21, 2011,
commit/4fdc30c by @sideshowbarker, with the comment
"summary attribute is not required on table in HTML5".

So you /MUST/ be running some earlier version?

Regards,
Geoff.


Reply | Threaded
Open this post in threaded view
|

Re: Query: HTML table summary attribute

Geoff McLane
In reply to this post by William Ingram
 From : Richard A O'Keefe [hidden email]

What should I do now to serve the purpose that the summary attribute
used to serve?

Richard, you forgot to use the 'Reply to Lists' button, so this only
arrived to me.



Reply | Threaded
Open this post in threaded view
|

Re: Query: HTML table summary attribute

Geoff McLane
In reply to this post by William Ingram
Richard, well, not too sure, but searching around found -

from : http://www.w3.org/TR/html-markup/table.html

The summary attribute on the table element is obsolete. Consider
describing the structure of the table in a caption element or in a
figure element containing the table element; or, simplify the structue
of the table so that no description is needed.

from : http://www.w3ctutorial.com/html5-tags/tag-table (note: NOT W3C
affiliate)

Differences Between HTML 4.01 and HTML5 - (on NOT border, cellpadding,
cellspacing, frame, rules, width) - Only the "summary" attribute is
supported in HTML5.

Tips and Notes - You should try not to use the "summary" attribute. If
the information in the "summary" attribute is important, you should use
a table caption or add a text paragraph before and/or after the table.

But then they counter themselves concerning summary with -
from : http://www.w3schools.com/tags/tag_table.asp

Differences Between HTML 4.01 and HTML5
The "align", "bgcolor", "border", "cellpadding", "cellspacing", "frame",
"rules", "summary", and "width" attributes are not supported in HTML5.

from :
http://www.developerfusion.com/article/136530/making-tables-more-accessible-with-html5/

The <caption> tag is the perfect vehicle for delivering the explanation
of a table’s function in HTML.

This thread asks the same question :
http://webaim.org/discussion/mail_thread?thread=5604

The main point is that any explanations about the purpose and
structure of a table that are needed for proper understanding should be
given in normal content before the table, or in the <caption> element.

Some discussions:
https://lists.w3.org/Archives/Public/public-html/2011Apr/0091.html

W3C Wiki -
http://www.w3.org/html/wg/wiki/ChangeProposals/SummaryAttribute20100222

And the W3C Spec for table in HTML5 :
http://www.w3.org/TR/2011/WD-html5-20110525/tabular-data.html

Note, I have also opened an issue -
https://github.com/htacg/tidy-html5/issues/210 - to further discuss this
point.