...

View Full Version : trouble validating: document type does not allow element



cyborg360
01-01-2010, 05:14 AM
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.



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>';

oesxyl
01-01-2010, 05:17 AM
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.



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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum