Reputation: 4562
I was trying to add the pagination functionality to my jsp. I have used the following codes. But only Prev Next
link is showing. all the records are listing in the same page.
Why it is happening?? Is there any other easy way to do pagination.?
<table align="right">
<tr>
<td class="cls2">
<div id="page" class="page">
<a href="" class="prev cls3"> <img src="/prev.gif" alt="" width="16" height="16" border="0">Prev</a>
<span class="pdisplay" ></span>
<a href="" class="next cls3">Next<img src="/next.gif" alt="" width="16" height="16" border="0"> </a>
</div>
</td>
</tr>
</table>
<table class="cls" cellpadding="1" cellspacing="0" border="0" width="100%" id="resultTbl">
<tbody> <thead>
<tr>
<th >Select</th>
<th><span id="isp" class="cls1"><%=request.getParameter("user")%></span></th>
</tr></thead>
<tr>
<td></td>
<td></td>
</tr>
</table>
jQuery I used :
<script type="text/javascript" src="my_js/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="my_js/jquery.tablesorter.pagerquote.js"></script>
<script defer="defer">
$("#resultTbl")
.tablesorter()
.tablesorterPager({container: $("#page")});
</script>
Upvotes: 0
Views: 788
Reputation: 5540
Try passing the container of your table,
$(document).ready(function() {
$("table")
.tablesorter()
.tablesorterPager({container: $("#page_container")});
});
Also i have poted the jsfiddle with working copy:
Also check for the following requirements:
jQuery (1.2.1 or higher)
Firefox 2+, Internet Explorer 6+, Safari 2+, Opera 9+,
Upvotes: 1