html部分
<div class="xssgd-left">
<div class="zhpjdfb-title">学生综合评价得分表</div>
<div class="tablebox">
<table id="tableId" border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th>学生姓名</th>
<th>学校</th>
<th>评分年度</th>
<th>综合得分</th>
<th style="width: 130px;">存证哈希</th>
</tr>
</thead>
<tbody>
<tr>
<td>熊又颖</td>
<td>上海市逸夫职业技术学校</td>
<td>2022</td>
<td>98</td>
<td>97ba3449-dd5c-4744-a30e-387e424bb319</td>
</tr>
<tr>
<td>王赞</td>
<td>上海市逸夫职业技术学校</td>
<td>2022</td>
<td>95</td>
<td>97ba3449-dd5c-4744-a30e-387e424bb319</td>
</tr>
<tr>
<td>郭嘉</td>
<td>上海市逸夫职业技术学校</td>
<td>2022</td>
<td>97</td>
<td>97ba3449-dd5c-4744-a30e-387e424bb319</td>
</tr>
<tr>
<td>张甜</td>
<td>上海市逸夫职业技术学校</td>
<td>2022</td>
<td>96</td>
<td>97ba3449-dd5c-4744-a30e-387e424bb319</td>
</tr>
<tr>
<td>李友友</td>
<td>上海市逸夫职业技术学校</td>
<td>2022</td>
<td>98</td>
<td>97ba3449-dd5c-4744-a30e-387e424bb319</td>
</tr>
</tbody>
</table>
</div>
</div>
css部分
.xssgd-left {
background: url("../images/xssgd-bg1.png") 100% 100% no-repeat;
width: 493px;
height: 352px;
position: absolute;
bottom: 10px;
left: 18px;
text-align: center;
}
table,
tbody,
tfoot,
thead,
tr,
th,
td {
margin: 0;
padding: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
border-collapse: collapse;
border-spacing: 0;
border: 0px;
}
.zhpjdfb-title {
font-size: 22px;
color: rgb(19, 223, 255);
margin-top: 5px;
}
.tablebox {
margin: 0 4px;
width: 485px;
height: 320px;
overflow: hidden;
}
.tablebox>table {
margin-top: 10px;
width: 100%;
}
.tablebox table th{
height: 30px;
font-size: 14px;
font-weight: 600;
line-height: 30px;
text-align: center;
}
.tablebox>table tr td:nth-child(1),.tablebox>table tr td:nth-child(2),.tablebox>table tr td:nth-child(3),.tablebox>table tr td:nth-child(4) {
/* background-color: yellow; */
height: 56px;
font-size: 14px;
line-height: 56px;
}
.tablebox>table tr td:nth-child(5){
font-size: 10px;
}
.tablebox table th {
color: rgb(19, 223, 255);
}
.tablebox table td img {
display: inline-block;
vertical-align: middle;
}
/* .tablebox table tbody tr:nth-child(even) {
background-color: rgb(11, 38, 65);
} */
.tablebox.table_md table td,
.tablebox.table_md table th {
line-height: 40px;
}
.height{
background-color: rgb(11, 38, 65);
color:rgb(19, 223, 255);
}
重头戏js部分
$(function() {
$("#tableId").find("tr:eq(" + 1 + ")").addClass("height").siblings().removeClass("height");
var tab = document.getElementById("tableId");
var rows = tab.rows.length;
var n = 0
setInterval(loop, 6000);
function loop() {
n++;
$("#tableId").find("tr:eq(" + n + ")").addClass("height").siblings().removeClass("height");
if (n % rows == 0) {
n = 0;
}
}
})