开发者

more than one table with th having duplicated ids

I was wondering if I could have more than one tables like below. If you notice, I have a开发者_如何学JAVApplied th with the id="id", and id="name". so If have the more than one tables then, there will be many ths with the same 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>


No. You can't. An id must be unique in the document.

The simplest option is to apply a prefix to each id in a given table e.g. id="mytable_name"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜