一個js分頁類,可把table分頁,有例項
阿新 • • 發佈:2019-01-10
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<title>無標題文件</title>
<script type="text/javascript"
window.onload =function(){
page =new Page(3,'table1','group_one'); };
</script>
</head>
<body>
<table id="table1" border="0" width="486">
<thead>
<tr style="background-color:#CCCCCC;">
<th style="cursor:pointer;">Last Name</th>
<th
<th style="cursor:pointer;">Birthday</th>
<th style="cursor:pointer;">Siblings</th>
</tr>
</thead>
<tbody id="group_one">
<tr style="background-color:#f3f3f3">
<td>Smith</td>
<td>John</td>
<td
<td>2</td>
</tr>
<tr style="background-color:#B4D6FC">
<td>Johnson</td>
<td>Betty</td>
<td>10/15/1977</td>
<td>4</td>
</tr>
<tr style="background-color:#f3f3f3">
<td>Henderson</td>
<td>Nathan</td>
<td>2/25/1949</td>
<td>1</td>
</tr>
<tr style="background-color:#B4D6FC">
<td>Williams</td>
<td>James</td>
<td>7/8/1980</td>
<td>4</td>
</tr>
<tr style="background-color:#f3f3f3">
<td>Gilliam</td>
<td>Micheal</td>
<td>7/22/1949</td>
<td>1</td>
</tr>
<tr style="background-color:#f3f3f3">
<td>Smith</td>
<td>John</td>
<td>7/12/1978</td>
<td>2</td>
</tr>
<tr style="background-color:#B4D6FC">
<td>Johnson</td>
<td>Betty</td>
<td>10/15/1977</td>
<td>4</td>
</tr>
<tr style="background-color:#f3f3f3">
<td>Henderson</td>
<td>Nathan</td>
<td>2/25/1949</td>
<td>1</td>
</tr>
<tr style="background-color:#B4D6FC">
<td>Williams</td>
<td>James</td>
<td>7/8/1980</td>
<td>4</td>
</tr>
<tr style="background-color:#f3f3f3">
<td>Gilliam</td>
<td>Micheal</td>
<td>7/22/1949</td>
<td>1</td>
</tr>
</tbody>
</table>
<span id="s"></span>
<table><tr><td><a href="#" onclick="page.nextPage();">下一頁</a></td><td><a href="#" onclick="page.prePage();">上一頁</a></td><td><span id="pageindex"></span></td></tr></table>
</body>
</html>