我想问一些事情,因为我真的很困惑为什么会发生这种情况,浏览器调试方法无法告诉我为什么会发生这种奇怪的元素添加。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Stuff Page</title>
</head>
<body>
<center>
<div>
<br/><br/>
<form method="POST">
Find Pattern
<input type="text" name="pattern" value="" /><input type="submit" value="Find" />
<input type="reset" value="Clear" />
</form>
</div>
</center>
<center>
<div>
<table>
<caption>Table Rendering of Found Data</caption>
<thead>
<tr>
<th scope="col" class="column1">Name<th>
<th scope="col">Type</th>
<th scope="col">Size</th>
</tr>
</thead>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</tfoot>
<tbody>
</tbody>
</table>
</div>
</center>
</body>
</html>
如果您获取那段 html 代码并在浏览器中运行它(我使用最新的 chrome 和 ff 对其进行了测试),它会在表中再添加一个元素(最后一页有 4 列而不是 3 列),我完全不知道为什么会这样!如果有人能告诉我背后的原因,我会很高兴!
您没有关闭代码。
"<th scope="col" class="column1">Name<th>
"最后一个<th>
应该是</th>
再次检查此行:
<th scope="col" class="column1">Name<th>