分页器分页渲染
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./utils.js"></script>
<style>
*{
margin: 0;
padding: 0;
}
ul{
list-style: none;
}
.pagination{
width: 600px;
height: 80px;
border: 2px solid pink;
margin: 30px auto;
padding-left: 200px;
}
.pagination > span, .pagination li{
float: left;
line-height: 80px;
padding: 0 5px;
cursor: pointer;
}
.pagination li.active{
color: red;
}
table{
width: 800px;
margin: 0 auto;
text-align: center;
border: 1px solid #333;
}
table > tbody > tr{
cursor: pointer;
}
table > tbody > tr:nth-child(odd){
background-color: pink;
}
table > tbody > tr:nth-child(even){
background-color: gray;
}
table > tbody > tr:hover{
background-color: #ccc;
color: #fff;
}
</style>
</head>
<body>
<div class="pagination">
<span class="first">首页</span>
<span class="prev">上一页</span>
<ul class="pageList"></ul>
<span class="next">下一页</span>
<span class="last">尾页</span>
</div>
<table cellspacing = "0">
<thead>
<tr>
<th>序号</th>
<th>ID</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
<th>班级</th>
<th>操作</th>
</tr>
</thead>
<tbody></tbody>
</table>
<script>