HTML

<html>
  <head>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    <script src="Jquery.js" type="text/javascript"></script>
    <script src="JavaScript.js" type="text/javascript"></script>
  </head>
  <title>斑马线</title>
  <body>
    <div id="bodydiv">
      <table cellspacing="0">
        <thead>
          <tr>
            <th>No</th>
            <th>Name</th>
            <th>Comments</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td>Lost In The Plot</td>
            <td>The Dears</td>
          </tr>
          <tr>
            <td>2</td>
            <td>Poison</td>
            <td>The Constantines</td>
          </tr>
          <tr>
            <td>3</td>
            <td>Plea From A Cat Named Virtute</td>
            <td>The Weakerthans</td>
          </tr>
          <tr>
            <td>4</td>
            <td>Melissa Louise</td>
            <td>Chixdiggit!</td>
          </tr>
          <tr>
            <td>5</td>
            <td>Living Room</td>
            <td>Tegan And Sara</td>
          </tr>
          <tr>
            <td>6</td>
            <td>Speed</td>
            <td>Bran Van 3000</td>
          </tr>
          <tr>
            <td>7</td>
            <td>Fast Money Blessing</td>
            <td>King Cobb Steelie</td>
          </tr>
          <tr>
            <td>8</td>
            <td>Sore</td>
            <td>Buck 65</td>
          </tr>
          <tr>
            <td>9</td>
            <td>Love Travel</td>
            <td>Danko Jones</td>
          </tr>
          <tr>
            <td>10</td>
            <td>You Never Let Me Down</td>
            <td>Furnaceface</td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>

CSS(StyleSheet.css)

body
{
width:100%;
height:100%;
margin:auto;
text-align:center;
}
#bodydiv
{
height:100%;
}

table
{
width: 100%;
}

JS(Jquery.js)

$(function(){
  //tr:eq(0)是指第一个tr eq=equal
  //tr:gt(0)是指除去第一个以外的所有tr gt=grater than
  $("tr:eq(0)").css("background-color","#8888ff"); //标题的样式
  $("tr:gt(0):even").css("background-color","#ffffcc"); //奇数行的样式
  $("tr:gt(0):odd").css("background-color","#ccccff"); //偶数行的样式
  $("tr:gt(0)").mouseenter(function(){
    var color = $(this).css("background-color");
    $(this).css("background-color","#5555ff");
    $(this).mouseleave(function(){
      $(this).css("background-color",color);
    });
    $(this).mousedown(function(){
      $(this).css("background-color","#2222ff");
    });
    $(this).mouseup(function(){
      $(this).css("background-color","#5555ff");
    });
  });
});

ref: http://www.cnblogs.com/lxblog/archive/2013/01/11/2856582.html

源码下载:http://files.cnblogs.com/zisezhixin/斑马线.zip

JQuery-Table斑马线的更多相关文章

  1. jQuery table td可编辑

    参考链接: http://www.freejs.net/ http://www.freejs.net/article_biaodan_34.html http://www.freejs.net/sea ...

  2. jquery.Table实现的翻页功能比较完整漂亮,本想扩展个模版DIV

    jquery.dataTable实现的翻页功能比较完整漂亮,本想提取其的翻页部分,再结合模版DIV,bootstrop实现聊天记息的展示. jquery.Table 与table结合的较紧,不能在很下 ...

  3. Jquery Table 的基本操作

    Jquery 操作 Html Table 是很方便的,这里对表格的基本操作进行一下简单的总结. 首先建立一个通用的表格css 和一个 表格Table: table { border-collapse: ...

  4. jquery table的隔行变色 鼠标事件

    一.鼠标事件 mouseover(function(){}); 鼠标移动到目标事件 mouseout(function(){}); 鼠标离开目标的事件 二.具体应用代码 <body> &l ...

  5. Jquery table元素操作-创建|数据填充|重置|隐藏行

    1.Jquery创建表格 /** * 创建表格 * @param label 标题 json格式,数据结构见附录1 * @param data 数据 json格式,数据结构见附录1 * @param ...

  6. jQuery,Table表头固定插件chromatable存在的问题及解决办法

    在最近的项目中需要将表格的表头固定,搜寻了大量的资料,发现chromatable插件还是比较方便的.但是当我在一个页面中多次使用 chromatable固定对个表格的表头时问题就出现了,首先说明系统的 ...

  7. jquery table 发送两次请求 解惑

    版本1.10 以下链接为一个较低版本解决方案: http://blog.csdn.net/anmo/article/details/17083125 而我的情况有点作, 情况描述: 1,一个页面两个t ...

  8. Jquery table相关--工时系统

    1.jquery 的弹出对话框,单击事件之后 if (confirm("确定要删除?")) { // //点击确定后操作 } 2.对某个table中的checkbox是否被选中的遍 ...

  9. 前端页面表格排序 jQuery Table 基础

    通常来说, 排序的方式有两种, 一种是我们在查询的时候就排好序,然后将数据渲染到前台页面上, 但是这样做有个弊端,就是在争对做好了缓存处理的系统, 在查询相同数据的时候进行排序,可能不能成功, 因为进 ...

  10. [Js/Jquery]table行转列

    摘要 在使用ews调用exhange的收件箱的并在h5页面显示邮件详情的时候,因为返回的每封邮件的内容都是htmlbody,没有textbody.每封邮件又没什么规律,用正则表达式来匹配内容并不合适, ...

随机推荐

  1. linux 命令之 insmod

    man insmod: INSMOD(8) insmod INSMOD(8) NAME insmod - Simple program to insert a module into the Linu ...

  2. compilation filed Unable to write to path xxxxxx 遇到这种情况的话

    如果是xib文件的话 查看target —>Build Phases —> Copy Bundle Resources里面查看路径. 可能有重复路径导致编译不通过.

  3. sdutoj 2604 Thrall’s Dream

    http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2604 Thrall’s Dream Time ...

  4. php初探

    1.php中的连接符.可以连接多个字符串,相当于java中的+ 2.echo必须与后面的输出内容有至少一个空格 3.php编程中每个结尾都需要添加分号

  5. checkbox的相关知识点

    1.获取单个checkbox选中项(三种写法)$("input:checkbox:checked").val()或者$("input:[type='checkbox']: ...

  6. Android -- 初探MVP模式

    1,相信大家对mvp模式都很熟悉了,M-Model-模型.V-View-视图.C-Controller-控制器.MVP作为MVC的版本演化,与MVC的意义类似:M-Model-模型.V-View-视图 ...

  7. paper 12:机器学习常见算法分类汇总

    机器学习无疑是当前数据分析领域的一个热点内容.很多人在平时的工作中都或多或少会用到机器学习的算法.这里南君先生为您总结一下常见的机器学习算法,以供您在工作和学习中参考. 机器学习的算法很多.很多时候困 ...

  8. Uploadify在MVC中使用方法案例(一个视图多次上传单张图片)

    Controller 中代码和 上一节文章(http://www.cnblogs.com/yechangzhong-826217795/p/3785842.html )一样 视图中代码如下: < ...

  9. Microsoft.Jet.OLEDB.4.0和Microsoft.ACE.OLEDB.12.0的区别

    Microsoft.Jet.OLEDB.4.0和Microsoft.ACE.OLEDB.12.0的区别 时间 2012-12-19 20:30:12  CSDN博客原文  http://blog.cs ...

  10. Beta—review阶段成员贡献分

    小组名称:nice! 小组成员:李权 于淼 刘芳芳 韩媛媛 宫丽君 项目内容:约跑app 分数分配规则 个人贡献分=项目基础分*0.5+个人表现分*0.5 基本贡献分 个人表现分 个人总分 于淼 2. ...