Access 5.2.1.1

From Htmlpedia
Jump to: navigation, search

Access: [5.2.1.1]: data <table> may require markup (column 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 'col' and 'colgroup'.

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>ID</th><th colspan="2">System<br/>Color or Name</th><th>Required</th>
	</tr>
	<tr>
		<td>a-1</td><td>blue</td><td></td><td>yes</td>
	</tr>
	<tr>
		<td>a-2</td><td></td><td>Susan</td><td>yes</td>
	</tr>
	<tr>
		<td>a-3</td><td>green</td><td></td><td>no</td>
	</tr>
	<tr>
		<td>a-4</td><td>orange</td><td></td><td>no</td>
	</tr>
	<tr>
		<td>a-5</td><td></td><td>Frank</td><td>yes</td>
	</tr>
	<tr>
		<td>a-6</td><td></td><td>Harold</td><td>no</td>
	</tr>
</table>

</body>
</html>

Solution:

References: