简体   繁体   English

标记验证

[英]Mark-up Validation

I am attempting to clean up some HTML after it being chopped and altered many times. 我尝试将一些HTML切碎并更改许多次后,对其进行清理。

When I go to Validate the page I keep getting a kick back saying this 当我转到“验证”页面时,我不断回踢说

"end tag for "table" which is not finished" “尚未完成的“表”的结束标记”

bit confused as i believe I closed it? 有点困惑,因为我相信我已经关闭了? here is a sample. 这是一个样本。

<table align="center" border="0" cellpadding="0" cellspacing="0" class="widthtable" width="650" />

I also tried 我也试过

<table align="center" border="0" cellpadding="0" cellspacing="0" class="widthtable" width="650"< </table>

thanks in advance. 提前致谢。

Look at the error message more closely. 仔细查看错误消息。

It says that it has found the end tag (so you have closed it) but that it is not finished. 它说已经找到了结束标签(所以您已经关闭了它),但是还没有完成。

Now look at the DTD : 现在看一下DTD

 <!ELEMENT TABLE - - (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)> 

Its children are: 它的孩子是:

  • An optional caption element 可选的标题元素
  • Any number of col and colgroup elements 任何数量的col和colgroup元素
  • An optional thead element 可选的thead元素
  • An optional tfoot element 可选的tfoot元素
  • At least one tbody element 至少一个肢体元素

You haven't added any children at all, so the mandatory first tbody element is missing. 您根本没有添加任何子代,因此缺少必需的第一个tbody元素。 This means the table isn't finished when you write the end tag for it. 这意味着当您为表编写结束标记时,表尚未完成。


A table without any children doesn't many any sense anyway. 一个没有孩子的桌子反正没有多大意义。

If you have no data, then you can't express that data in the form of a table. 如果没有数据,则无法以表的形式表示该数据。


NB: With the exception of the class attribute, every attribute you have used was superseded by CSS a decade ago. 注意:除了class属性,十年前CSS取代了您使用的每个属性。

You should close your table tags correctly. 您应该正确关闭表格标签。

<table .. **>**</table>


<table align="center" border="0" cellpadding="0" cellspacing="0" class="widthtable" width="650"> </table>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM