I'm getting this W3C HTML validation error:
end tag for "table" which is not finished
for this code:
<table id="myTable">
</table>
This is my DOCTYPE:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
I thought that table definition was perfectly fine!?
If you look at the XHTML 1.0 Strict DTD, it specifies that a table requires at least one of TR
OR TBODY
:
<!ELEMENT table
(caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
<!ELEMENT caption %Inline;>
<!ELEMENT thead (tr)+>
<!ELEMENT tfoot (tr)+>
<!ELEMENT tbody (tr)+>
<!ELEMENT colgroup (col)*>
<!ELEMENT col EMPTY>
<!ELEMENT tr (th|td)+>
<!ELEMENT th %Flow;>
<!ELEMENT td %Flow;>
The TR
, in its turn, requires at least one of TH
or TD
.
The +
sign after an element name means it should appear at least once.
I believe there should be a tr and td tags inside a table to validate. It's the same when you close a head tag without including a title tag
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With