$("table.datalist tr:nth-child(odd)").addClass("altrow");

 <script>

$(document).ready(function() {
$('tr').addClass('odd');
$('tr:even').addClass('even'); //奇偶变色,添加样式
});
</script>
<style>
#hacker tr:hover{
background-color:red;    //使用CSS伪类达到鼠标移入行变色的效果,比Jquery 的mouseover,hover 好用
}

.odd {
background-color: #ffc; /* pale yellow for odd rows */
}
.even {
background-color: #cef; /* pale blue for even rows */
}
</style>
</head>
<body>
<table >

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-06-11
  • 2022-12-23
  • 2021-07-20
  • 2021-08-26
  • 2021-09-30
猜你喜欢
  • 2022-12-23
  • 2021-07-17
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-10-21
相关资源
相似解决方案