css设置datatable表格奇偶数行或者奇偶数列背景色不同

奇偶数行背景色不同:

/*设置表格奇偶数行背景色不同*/
.table-responsive table tbody tr:nth-child(even){
    background: rgba(250,250,255,1)
}
.table-responsive table tbody tr:nth-child(odd){
    background:rgba(255,255,255,1);
}

奇偶数列背景色不同:

/*设置表格奇偶数列背景色不同*/
.table-responsive table tbody th:nth-child(even){
    background: rgba(250,250,255,1)
}
.table-responsive table tbody th:nth-child(odd){
    background:rgba(255,255,255,1);
}

猜你喜欢

转载自blog.csdn.net/animatecat/article/details/81110482