小编Adr*_*ian的帖子

jQuery:突出显示偶数列(不是行)

如何使用jQuery为偶数(或奇数)表列着色?(不手动添加类)

我的标记是:

<table>
   <caption>Table caption</caption>
   <thead>
   <tr><th scope="col">Table header 1</th><th scope="col">Table header 2</th><th scope="col">Table header 3</th><th scope="col">Table header 3</th></tr>
   </thead>
   <tbody>

        <tr><th scope="row">Table row header</th><td>Table data</td><td>Table data</td><td>Table data</td></tr>
        <tr><th scope="row">Table row header</th><td>Table data</td><td>Table data</td><td>Table data</td></tr>
        <tr><th scope="row">Table row header</th><td>Table data</td><td>Table data</td><td>Table data</td></tr>

        <tr><th scope="row">Table row header</th><td>Table data</td><td>Table data</td><td>Table data</td></tr>
   </tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

(它可能包含也可能不包含范围属性或th标签)

html css jquery jquery-selectors

5
推荐指数
1
解决办法
1657
查看次数

标签 统计

css ×1

html ×1

jquery ×1

jquery-selectors ×1