我想为下面的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/javascript">
$(document).ready(function(){
$('#paging_container3').pajinate({
num_page_links_to_display : 1,
items_per_page : 1,
}(jQuery));
});
</script>
在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.
有关更多详细信息,请通过此链接。https://github.com/wesnolte/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>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句