jQuery实现过滤器
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <script src="scripts/jquery-1.8.2.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $('#table1 tr:first').css('font-size', '30px'); $('#table1 tr:last').css('color', 'red'); $('#table1 tr:gt(0):lt(3)').css('fontSize', '28px'); $('#table1 tr:odd').css('backgroundColor', 'red'); }); </script></head><body> <table id="table1" border="1"> <tr> <td> 姓名 </td> <td> 分数 </td> </tr> <tr> <td> zhangsan </td> <td> 100 </td> </tr> <tr> <td> lisi </td> <td> 99 </td> </tr> <tr> <td> wangwu </td> <td> 98 </td> </tr> <tr> <td> zhaoliu </td> <td> 97 </td> </tr> <tr> <td> zhouba </td> <td> 97 </td> </tr> <tr> <td> 平均分 </td> <td> 98 </td> </tr> </table></body></html>