squizlabs/HTML_CodeSniffer — pull request #20 by lwright-sq (2012-07-26 23:37:51+00:00)
Title: Add function to detect layout tables, and adjust SC 1.3.1 tests for them

Previously HTML_CodeSniffer assumed all tables were data tables, because it had no ability to determine what is a layout table (using tables purely for presentation purposes) and what is a data table. This caused some false positives/negatives with layout tables, which although discouraged, do not fail WCAG 2.0.

These commits bring it in line with the testing of some other checkers, which look for whether the table has any "th" elements to determine whether it is a data or layout table.

Layout tables should not have a summary attribute, caption element, or th elements. A notice is emitted on each table to state what type of table it is, and saying "if it is not that type of table, then do this, this and this to fix it".

Summary and caption tests have also been adjusted depending on whether the table is layout or not.