Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Nov 2009
    Posts
    202
    Thanks
    25
    Thanked 0 Times in 0 Posts

    trouble validating: document type does not allow element

    document type does not allow element "table" here
    …g="0" cellpadding="0" align="center"><tr><td height="80px" valign="middle"><t

    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).
    why does the validator have a problem here? from the error msg it sounds like its saying im doing something like putting a table in a div, but as far as I can tell, these tables are just part of some javascript code.


    Code:
     var singletext=new Array();
    singletext[0]='<table cellspacing="0" cellpadding="0" align="center"><tr><td height="80px" valign="middle"><table align="center"><tr><td></td><td align="center"><a class=tabb target="_self" href="http://tccgltd.com">Example Link</a></td><td></td></tr></table><div class=tanc>This is a sample news item.<br></br> ..............................<br> .............................. <br>  ..............................</div></td></tr></table>';
    singletext[1]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td height="80px" valign="middle"><table align="center"><tr><td></td><td align="center"><a class=tabb target="_self" href="http://msn.com">Example Link2</a></td><td></td></tr></table><div class=tanc>This is a second sample item.<br></br> ..............................<br> .............................. <br> ..............................</div></td></tr></table>';
    singletext[2]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td height="80px" valign="middle"><table align="center"><tr><td></td><td align="center"><a class=tabb target="_self" href="http://tccgltd.com">Example Link</a></td><td></td></tr></table><div class=tanc>TCCG TCCG TCCG TCCG TCCG TCCG<br></br> TCCG TCCG TCCG TCCG TCCG TCCG<br> TCCG TCCG TCCG TCCG TCCG TCCG <br>  TCCG TCCG TCCG TCCG TCCG TCCG</div></td></tr></table>';
    singletext[3]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td height="80px" valign="middle"><table align="center"><tr><td></td><td align="center"><a class=tabb target="_self" href="http://tccgltd.com">Example Link</a></td><td></td></tr></table><div class=tanc>TCCG TCCG TCCG TCCG TCCG TCCG<br></br> TCCG TCCG TCCG TCCG TCCG TCCG<br> TCCG TCCG TCCG TCCG TCCG TCCG <br>  TCCG TCCG TCCG TCCG TCCG TCCG</div></td></tr></table>';
    singletext[4]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td height="80px" valign="middle"><table align="center"><tr><td></td><td align="center"><a class=tabb target="_self" href="http://tccgltd.com">Example Link</a></td><td></td></tr></table><div class=tanc>TCCG TCCG TCCG TCCG TCCG TCCG<br></br> TCCG TCCG TCCG TCCG TCCG TCCG<br> TCCG TCCG TCCG TCCG TCCG TCCG <br>  TCCG TCCG TCCG TCCG TCCG TCCG</div></td></tr></table>';

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by cyborg360 View Post
    why does the validator have a problem here? from the error msg it sounds like its saying im doing something like putting a table in a div, but as far as I can tell, these tables are just part of some javascript code.


    Code:
     var singletext=new Array();
    singletext[0]='<table cellspacing="0" cellpadding="0" align="center"><tr><td height="80px" valign="middle"><table align="center"><tr><td></td><td align="center"><a class=tabb target="_self" href="http://tccgltd.com">Example Link</a></td><td></td></tr></table><div class=tanc>This is a sample news item.<br></br> ..............................<br> .............................. <br>  ..............................</div></td></tr></table>';
    singletext[1]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td height="80px" valign="middle"><table align="center"><tr><td></td><td align="center"><a class=tabb target="_self" href="http://msn.com">Example Link2</a></td><td></td></tr></table><div class=tanc>This is a second sample item.<br></br> ..............................<br> .............................. <br> ..............................</div></td></tr></table>';
    singletext[2]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td height="80px" valign="middle"><table align="center"><tr><td></td><td align="center"><a class=tabb target="_self" href="http://tccgltd.com">Example Link</a></td><td></td></tr></table><div class=tanc>TCCG TCCG TCCG TCCG TCCG TCCG<br></br> TCCG TCCG TCCG TCCG TCCG TCCG<br> TCCG TCCG TCCG TCCG TCCG TCCG <br>  TCCG TCCG TCCG TCCG TCCG TCCG</div></td></tr></table>';
    singletext[3]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td height="80px" valign="middle"><table align="center"><tr><td></td><td align="center"><a class=tabb target="_self" href="http://tccgltd.com">Example Link</a></td><td></td></tr></table><div class=tanc>TCCG TCCG TCCG TCCG TCCG TCCG<br></br> TCCG TCCG TCCG TCCG TCCG TCCG<br> TCCG TCCG TCCG TCCG TCCG TCCG <br>  TCCG TCCG TCCG TCCG TCCG TCCG</div></td></tr></table>';
    singletext[4]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td height="80px" valign="middle"><table align="center"><tr><td></td><td align="center"><a class=tabb target="_self" href="http://tccgltd.com">Example Link</a></td><td></td></tr></table><div class=tanc>TCCG TCCG TCCG TCCG TCCG TCCG<br></br> TCCG TCCG TCCG TCCG TCCG TCCG<br> TCCG TCCG TCCG TCCG TCCG TCCG <br>  TCCG TCCG TCCG TCCG TCCG TCCG</div></td></tr></table>';
    use comments and cdata in the script block from the head seaction.
    most of the error messages come from there.

    best regards


  •  

    Posting Permissions

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