我想知道是否可以有多个如下所示的表。如果您注意到,我已经应用了 id="id"和 id="name"。所以如果有多个表,那么就会有很多具有相同 id 的表。
<table>
<thead>
<tr><th id="id"></th><th id="name"></th></tr>
</thead>
<tbody>
<tr><td headers="id">1</td><td headers="name">First Name</td></tr>
</tbody>
</table>
最佳答案
没有。你不能。 id 在文档中必须是唯一的。
最简单的选择是为给定表中的每个 id 应用前缀,例如id="mytable_name"
关于xhtml - 多个表具有重复的 id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2135835/