SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Why do I get this error?

    Hello,
    This is rather urgent and I would appreciate a quick reply.

    Right, I have the following code:

    Code HTML4Strict:
    <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.
    <tfoot>✉
    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.

    Thanks

    Neil

  2. #2
    SitePoint Member
    Join Date
    Jun 2007
    Location
    Finland
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The tfoot element must be placed between thead and tbody.

    Quote Originally Posted by HTML 4.0/4.01 Specification
    Table rows may be grouped into a table head, table foot, and one or more table body sections, using the THEAD, TFOOT and TBODY elements, respectively. This division enables user agents to support scrolling of table bodies independently of the table head and foot. When long tables are printed, the table head and foot information may be repeated on each page that contains table data.

  3. #3
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers, Thanks for that.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •