[Jquery]斑马线表格
<!doctype html> <html> <head> <script src=‘js/jquery-1.9.1.min.js‘></script> <script type="text/javascript"> $(document).ready(function() { $(‘tr:even‘).css(‘background‘,‘#dedede‘); $(‘tr:odd‘).css(‘background‘,‘#ffffff‘); }); </script> <body> <table> <tr> <th>Product</th> <th>Description</th> <th>Price</th> </tr> <tr> <td>Paper Towels</td> <td>The most absorbent paper towels.</td> <td>$18.99</td> </tr> <tr> <td>Paper Napkins</td> <td>Perfect for your outdoor gathering.</td> <td>$16.99</td> </tr> <tr> <td>Paper Plates</td> <td>The best value.</td> <td>$5.99</td> </tr> <tr> <td>Plastic Forks</td> <td>The essential picnic accessory.</td> <td>$2.99</td> </tr> </table> </body> </html>
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。