<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
<meta charset="utf-8" />
    <script src="jquery-3.3.1.js"></script>
    <script>
        $(function () {
            $('#btn').click(function () {
                $('#tb tr:first').css('fontSize', '30px');//第一行
                $('#tb tr:last').css('color', 'red');//最后一行
                $('#tb tr:gt(0):lt(3)').css('fontSize', '28px');//正文前三行
                $('#tb tr:odd').css('backgroundColor', 'red');//偶数行
            });
            $('#tb tr').click(function () {
                $(this).css('backgroundColor', 'yellow').siblings('tr').css('backgroundColor','');//点谁谁变黄色
            });
        });
    </script>
</head>
<body>
    <input type="button" name="name" value="显示效果" id="btn" />
    <table border="1" id="tb" style="cursor:pointer">
        <tr>
            <td>姓名</td>
            <td>年龄</td>
        </tr>
        <tr>
            <td>张三</td>
            <td>30</td>
        </tr>
        <tr>
            <td>李四</td>
            <td>50</td>
        </tr>
        <tr>
            <td>王五</td>
            <td>48</td>
        </tr>
        <tr>
            <td>陈六</td>
            <td>17</td>
        </tr>
        <tr>
            <td>赵七</td>
            <td>56</td>
        </tr>
        <tr>
            <td>张八</td>
            <td>98</td>
        </tr>
        <tr>
            <td>吕九</td>
            <td>20</td>
        </tr>
        <tr>
            <td>汇总</td>
            <td>600</td>
        </tr>
    </table>
</body>
</html>

最新文章

  1. CSS DIV自动适应高度
  2. MVC4.0
  3. C#Random函数在循环中每次获取一样的值
  4. CentOS7 PostgreSQL安装
  5. win7局域网里输入正确密码也访问不了其他的机器
  6. linux设备分类
  7. Eclipse执行Hadoop WordCount
  8. SQL Server 事务与锁
  9. WIN7下运行hadoop程序报:Failed to locate the winutils binary in the hadoop binary path
  10. onhashchange事件--司徒正美
  11. 3p
  12. (中等) UESTC 94 Bracket Sequence,线段树+括号。
  13. shell日志删除(超容量&amp;自动)
  14. [DeeplearningAI笔记]神经网络与深度学习人工智能行业大师访谈
  15. OpenGL渲染管线(rendering pipeline)
  16. python的高级数组之稀疏矩阵
  17. 域scope 介绍,及查找数据
  18. Solr调研总结(转)
  19. mybatis由浅入深day01_8输出映射_8.1resultType输出类型(8.1.1输出简单类型_8.1.2输出pojo对象和pojo列表_8.1.3输出hashmap)
  20. SVN提交修改时出现:Checksum mismatch

热门文章

  1. 清楚arp
  2. RandomStringUtils RandomUtils
  3. [Angular Directive] Structure directive and &lt;template&gt;
  4. 【t075】郁闷的记者
  5. Windows下的bat中文乱码问题
  6. 对多线程java内存模型JMM
  7. 修改NuGet packages目录路径
  8. OpenCV中CvSVM部分函数解读
  9. 【50.88%】【Codeforces round 382B】Urbanization
  10. WPF中选择文件及文件夹