2013-12-18 68 views
1

我想问一些问题,因为我真的很困惑为什么发生这种情况,浏览器调试方法无法告诉我为什么会出现这种奇怪的元素添加。在html表格元素中添加了新的元素

<!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 ),我完全不知道为什么会发生这种情况!如果有人能告诉我背后的原因,我会很高兴!

回答

4

您没有关闭标签。

<th scope="col" class="column1">Name<th>” 最后<th>应该是</th>

+0

有时你可真愚蠢。感谢第二只眼@ RugerSR9! – jtimz

2

再次检查这行:

<th scope="col" class="column1">Name<th>