【发布时间】:2011-05-16 17:36:23
【问题描述】:
我正在尝试创建一个表格,当有超过 10 行时,我想创建一个超链接,告诉用户转到下一页。这个概念叫做分页,但是我怎样才能用jQuery/JavaScript来实现呢?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Table</title>
<style type="text/css">
th {
background-color: #ddd;
}
th td {
border: 1px solid black;
}
</style>
</head>
<body>
<table>
<th>Heading1</th>
<th>Heading2</th>
<tbody>
<tr><td>This is td</td><td>This is td</td></tr>
<tr><td>This is td</td><td>This is td</td></tr>
<tr><td>This is td</td><td>This is td</td></tr>
<tr><td>This is td</td><td>This is td</td></tr>
<tr><td>This is td</td><td>This is td</td></tr>
<tr><td>This is td</td><td>This is td</td></tr>
<tr><td>This is td</td><td>This is td</td></tr>
<tr><td>This is td</td><td>This is td</td></tr>
<tr><td>This is td</td><td>This is td</td></tr>
<tr></tr>
</tbody>
</table>
</body>
</html>
【问题讨论】:
-
您使用的是服务器端语言吗?
标签: javascript jquery html pagination html-table