表格table隔行变色

if($('.p03-s2').find('table').length >= 2) {
$('table:last-child').css({
'borderTop': 'none'
});
}
if($('.p03-s2').find('th').length) {
$('thead').css({
'backgroundColor' : '#edf0f2'
});
$('tbody').css({
'backgroundColor' : '#fff'
});
} else {
$('tbody').css({
'backgroundColor' : 'none'
});
$('tr:even td').css({
'backgroundColor' : '#edf0f2',
'color': '#808080'
});
$('tr:odd').css({
'backgroundColor' : '#fff',
'color': '#333'
});
}

posted on 2019-10-15 18:02  巧丽  阅读(424)  评论(0编辑  收藏  举报

导航