1 知识点

  • 找出表中所有的行:"tr"
  • 找出表中的奇数行:"tr:odd"
  • 找出表中的偶数行且不包含第0行:"tr":even:gt(0)

2 实现

<script type="text/javascript">
	$(function(){
		$("tr:even:gt(0)").css("background","green");
		$("tr:odd").css("background","gray");
	});
</script>

三、案例:使用jQuery完成表格的隔行换色

相关文章:

  • 2022-02-06
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2021-07-28
  • 2022-02-15
  • 2021-10-22
  • 2021-08-07
猜你喜欢
  • 2022-12-23
  • 2021-12-07
  • 2022-01-16
  • 2021-12-13
  • 2021-11-02
  • 2021-11-18
  • 2022-12-23
相关资源
相似解决方案