Access 5.2.1.2

From Htmlpedia
Jump to: navigation, search

Access: [5.2.1.2]: data <table> may require markup (row headers) (Priority 1)

Cause:

If a data table has two or more logical levels of row or column headings, use html markup to link data cells with their corresponding headers. To identify groups of rows, use the 'thead', 'tfoot', and 'tbody' elements. To group columns, use the 'col' and 'colgroup' elements.

Example:

Bad
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>aert1.0/5.2.1</title>
</head>
<body>

<table summary="This data table should use markup to associate multiple levels of row and column headers">
	<caption>This data table should use markup to associate multiple levels of row and column headers</caption>

	<tr>
		<th>System</th><td>a-1</td><td>Susan</td><td>Macintosh</td>
	</tr>
	<tr>
		<th rowspan="2">ID<br>location or code</th><td>Local</td><td>Building 1</td><td>Front Desk</td>
	</tr>
	<tr>
		<td>Local</td><td>Building 2</td><td>Back Desk</td>
	</tr>
	<tr>
		<th>Required</th><td>yes</td>yes<td></td><td>no</td>
	</tr>
</table>

</body>
</html>

Solution:

References: