End tag for “TABLE” omitted, but its declaration does not permit this
</div>
You forgot to close a tag, or
you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.
The next message, “start tag was here” points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.
You have an element with a background attribute. No such attribute exists. So remove it.
This is an attribute (in bold)
<element foo=“bar”>Text</element>
It looks like you want to add a background image to an element. If the element doesn’t already have an id attribute or class attribute, you can give it one and state the background image in the CSS stylesheet instead.
<element class=“image”>Text</element>
in CSS
.image {
background: url(referencetheimage.png) 0 0 no-repeat;
}
is an example.
Second Error:
Error message:
End tag for “TABLE” omitted, but its declaration does not permit this
</div>
You forgot to close a tag, or
you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.
So did you find your </table> tag? Unless you’ve got lots and lots and lots of hairy code, you should be able to make sure that for every <table> tag, there’s a </table> tag.
You can get this error also though if you did something like wrap a table in some inline element (like a span or an anchor). Those is no-nos.
Don’t worry much about this error. When you fix error #2, it will also solve this error #3. What error #3 tells you is where to start counting your <table> tags so you know if you have enough </table> tags.
The code for the first error outputs as HTML but it is actually taken from a php file, can you advise me where in the below code the element part would go?
The simplest way to fix the table error is to remove the table that you currently have incorrectly wrapped around your content. The content isn’t tabular data and so shouldn’t be in a table at all.
Well I didn’t write the code but I am trying to clean it up, the page is (flamingolandrentals.co.uk) I haven’t linked it as I don’t want this link indexed.
Again any help with these last couple would be much appreciated
On line 3224, you could try a few things, like replace the </div> with </table>, or just add </table> etc. (It’s a bit hard to know what’s supposed to be there without trawling through all the code and matching tags, which is a bit of a pain.
felgall’s suggestion was a good one. Could you post here the code you used to try his suggestion about the background?
These errors are not serious. The validator is just there to flag potential issues, but if the site is rendering fine, it’s not the end of the world. Still, it’s nice to clean things up.
Well I tried replacing it with </table> and it messed up the page, so I put it back to how it was it originally and now for some reason it validates (shrug).
That only leaves me with the first error. I tried as felgall suggested:
Choose a name that best describes the element or why it has an image or something, if you can. “image” was only an example because we have zero context.
Just one final question, is there another way to write color codes for firefox, rather that #000000, I am trying to validate my CSS and these are the only errors.
There is nothing wrong with with hex colour of; #000000 you probably have an error elsewhere in the CSS, with CSS you could have used; rgb(0,0,0); or just shorthand #000 or the color name value of; black in this case.
I tried adding the class tag again like the above but it hasn’t worked this time.
The other error is what I think removing may have messed up the functioning of my site, it says:
document type does not allow element “BODY” here
If you look at the page source (flamingolandrentals.co.uk) you will see on line 114 there is a <body> tag, in the php file I tried deleting it and the text editor on my site doesn’t show.
There are other errors that the Validator didn’t catch such as in the invalid hex colours. Though the BODY start tag SHOULD NOT have a space before the right “>” <body > it of course should be written <body> and start BODY tag MUST come directly after the closing HEAD tag that will solve some issues.
Background images should always be the domain of CSS not HTML so use CSS for any background images on the TABLE. HTML is a structural language and doesn’t concern itself with any such decoration.