I am trying to create a table in an XHTML document shown below (only relevant parts shown for brevity sake):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>
<table class="dataTable">
<tfoot><tr><td class="tableFooter" colspan="4"><span>© example.com</span></td></tr></tfoot>
<tbody>
<tr id = "firstRowHeader">
<th class="rowLabel">
<th class ="rowCol colHeader">ABC
<th class ="rowCol colHeader">CDE
<th class ="rowCol colHeader">EFG
<tr><td class ="rowCategory" colspan ="4">Foo
<tr><td class="rowLabel"
<td class ="rowCol cellDataDown">-0.01%
<td class ="rowCol cellDataNoChange">0.09%
<td class ="rowCol cellDataNoChange">717.79
<tr><td class="rowLabel"
<td class ="rowCol cellDataUp">0.00%
<td class ="rowCol cellDataNoChange">0.08%
<td class ="rowCol cellDataNoChange">1,032.02
<tr><td class="rowLabel"
<td class ="rowCol cellDataUp">-0.04%
<td class ="rowCol cellDataNoChange">0.03%
<td class ="rowCol cellDataNoChange">819.17
<tr><td class="rowLabel"
<td class ="rowCol cellDataUp">-0.03%
<td class ="rowCol cellDataNoChange">0.05%
<td class ="rowCol cellDataNoChange">877.45
<tr><td class="rowLabel"
<td class ="rowCol cellDataUp">-0.00%
<td class ="rowCol cellDataNoChange">0.09%
<td class ="rowCol cellDataNoChange">991.57
<tr><td class="rowLabel"
<td class ="rowCol cellDataUp">-0.02%
<td class ="rowCol cellDataNoChange">0.05%
<td class ="rowCol cellDataNoChange">835.42
<tr><td class="rowLabel"
<td class ="rowCol cellDataUp">0.00%
<td class ="rowCol cellDataNoChange">0.05%
<td class ="rowCol cellDataNoChange">1,002.40
<tr><td class="rowLabel"
<td class ="rowCol cellDataDown">-0.01%
<td class ="rowCol cellDataNoChange">0.05%
<td class ="rowCol cellDataNoChange">860.27
</tbody>
</table>
</body>
</html>
When I run this doc through the w3c validator, I got several errors of the variety – Document type does not allow ‘th’ (or ‘td’) here. Can someone point out how to fix this?
You’re not closing any of your
<td>or<tr>tags with</tr>or</td>. Also, you’ve missed a>off all of your<td>tags.