页面中如果有多个表格时,使每个表都从第一行计数

jqery代码:

$('tr:nth-child(odd)').addClass('alt');


css代码:

.alt {

 background-color: #ccc;

}


PS:另一行为背景色为默认颜色。