Rob*_*non 5 html html-table w3c-validation
我收到此W3C HTML验证错误:
end tag for "table" which is not finished
Run Code Online (Sandbox Code Playgroud)
对于此代码:
<table id="myTable">
</table>
Run Code Online (Sandbox Code Playgroud)
这是我的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">
Run Code Online (Sandbox Code Playgroud)
我认为表的定义非常好!?
如果查看XHTML 1.0 Strict DTD,它指定一个表至少需要一个TROR 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;>
Run Code Online (Sandbox Code Playgroud)
的TR,反过来,需要至少一个TH或TD.
该+元素的名称注册成功后意味着它应该出现至少一次.