Results 1 to 3 of 3
Thread: Why do I get this error?
Mar 4, 2008, 15:05 #1
Why do I get this error?
This is rather urgent and I would appreciate a quick reply.
Right, I have the following code:
<table> <thead> <tr> <td> First Row </td> </tr> </thead> <tbody> <tr> <td> Second Row </td> </tr> </tbody> <tfoot> <tr> <td> Third Row </td> </tr> </tfoot> </table>
My full page where this code is taken from validates 100% fine in the 3c3 validator for HTML Version 4.0.0 Strict. It MUST be this version and not 4.0.1.
When I add in the code for the table above I get the follwong error:
Line 242, Column 13: document type does not allow element "TFOOT" here.
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
As I said above, without the table code, the page validates fine and everything is perfect. I would appreciate some assistance to help me remove this error.
Mar 4, 2008, 16:40 #2
- Join Date
- Jun 2007
- 0 Post(s)
- 0 Thread(s)
The tfoot element must be placed between thead and tbody.
Originally Posted by HTML 4.0/4.01 Specification
Mar 6, 2008, 13:19 #3
Cheers, Thanks for that.