Jquery 分页不适用于表概念
我想为下面的jsp表实现分页,其中名称、标题和类型将从数据库中检索。我想列出每页1个数据 在标题中,我使用了以下代码Jquery 分页不适用于表概念,jquery,jsp,pagination,Jquery,Jsp,Pagination,我想为下面的jsp表实现分页,其中名称、标题和类型将从数据库中检索。我想列出每页1个数据 在标题中,我使用了以下代码 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="/Fileupload/js/jquery.paginate.js"></script> <script type="text/java
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="/Fileupload/js/jquery.paginate.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#paging_container3').pajinate({
num_page_links_to_display : 1,
items_per_page : 1,
}(jQuery));
});
</script>
$(文档).ready(函数(){
$(“#分页_container3”).pajinate({
页面链接到显示:1,
每页的项目:1,
}(jQuery));
});
在jsp文件中,我有以下代码
<div id="paging_container3">
<table border="1" id="myTable">
<tbody>
<tr>
<td><b>Name</b></td>
<td><b>Title</b></td>
<td><b>Genre</b></td>
<%
while(rs.next())
{
String name = rs.getString("Name");
String title = rs.getString("Title");
String genre = rs.getString("Genre");
%>
<tr><td><%=name %></td><td><%=title %></td><td><%=genre %></td></tr>
<%
}
%>
</tbody>
</table>
</div>
名称
标题
体裁
任何人都可以建议我应该集中精力解决这个问题。请提前感谢请确保您遵循这些,并检查您的
pajinate.js
路径
DEFAULT USAGE
---------------------------------
1) Place pajinate-x.x folder somewhere in your website directory structure.
2) Include script tags for the desired version of the script.
3) Create at least one <div> in your HTML with a CSS class
value of "page_navigation". The navigation links will be
attached to these divs.
4) Ensure that all items you would like to page through are
all the first-children of an HTML element with a CSS
class value of "content". The child-elements can be of any tag type.
5) Call the Pajinate plugin with the function.
默认用法
---------------------------------
1) 将pajinate-x.x文件夹放在网站目录结构中的某个位置。
2) 包括所需脚本版本的脚本标记。
3) 使用CSS类在HTML中至少创建一个
“页面导航”的值。导航链接将被删除
附在这些div上。
4) 确保您要翻页浏览的所有项目都已完成
带有CSS的HTML元素的所有第一个子元素
“内容”的阶级价值。子元素可以是任何标记类型。
5) 使用函数调用Pajinate插件。
有关更多详细信息,请访问此链接。
. 可能是你的html需要如下所示
<div id="page_container">
<div class="page_navigation"></div>
<ul class="content">
<li> <p>One</p> </li>
<li> <p>Two</p> </li>
<li> <p>Three</p> </li>
<li> <p>Four</p> </li>
<li> <p>Five</p> </li>
<li> <p>Six</p> </li>
<li> <p>Seven</p> </li>
<li> <p>Eight</p> </li>
</ul>
</div>
</div>
- 1个
- 两个
- 三个
- 4个
- 5个
- 6个
- 7个
- 8个
你能详细说明一下不工作吗?你有什么错误吗?我的错误是({num\u page\u links\u to\u display:1,items\u per\u page:1})
不是一个函数。你检查了没有正确关闭的表行吗?谢谢vinoth,我错过了上面列出的3点。现在问题解决了。不客气,请将此标记为答案。所以其他人会利用这个答案。