- Author: Liao, San-Kai
- Version: 1.0.0 (changelog)
- Licence: Dual licensed under MIT or GPL licenses.
- Support:IE 6.0+, FF 2+, Safari 2.0+, Opera 9.0+
Demo
| Example | Javascript | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
$().ready(function(){
demo = tablePager(); demo.setPagerInfo($().val()); $().text(demo1.pagerInfo()); $().({ demo.setPageSize($(this).val()); demo.setPagerInfo($().val()); $().text(demo.pagerInfo()); }) $().({ demo.moveSetPage($().val()); demo.setPagerInfo($().val()); $().text(demo.pagerInfo()); }); $().({ demo.moveFirstPage(); $().text(demo.pagerInfo()); }); $().({ demo.movePrevPage(); $('#info').text(demo.pagerInfo()); }); $().({ demo.moveNextPage(); $().text(demo.pagerInfo()); }); $().({ demo.moveLastPage(); $().text(demo.pagerInfo()); }); }); |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Getting started
include the jQuery
library and the tablepager plugin inside the <head> tag
of your HTML document:
<head>
<script type="text/javascript" src="jquery-latest.js"></script>
<script type="text/javascript" src="jquery.tablepager.js"></script>
</head>
<script type="text/javascript" src="jquery-latest.js"></script>
<script type="text/javascript" src="jquery.tablepager.js"></script>
</head>
tablepager works on standard HTML tables. You must include THEAD and TBODY tags like as :
<table>
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Email</th>
<th>Due</th>
<th>Web Site</th>
</tr>
<tr>
<td>Smith</td>
<td>John</td>
<td>jsmith@gmail.com</td>
<td>$50.00</td>
<td>http://www.jsmith.com</td>
</tr>
<tr>
<td>Bach</td>
<td>Frank</td>
<td>fbach@yahoo.com</td>
<td>$50.00</td>
<td>http://www.frank.com</td>
</tr>
<tr>
<td>Doe</td>
<td>Jason</td>
<td>jdoe@hotmail.com</td>
<td>$100.00</td>
<td>http://www.jdoe.com</td>
</tr>
<tr>
<td>Conway</td>
<td>Tim</td>
<td>tconway@earthlink.net</td>
<td>$50.00</td>
<td>http://www.timconway.com</td>
</tr>
</table>
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Email</th>
<th>Due</th>
<th>Web Site</th>
</tr>
<tr>
<td>Smith</td>
<td>John</td>
<td>jsmith@gmail.com</td>
<td>$50.00</td>
<td>http://www.jsmith.com</td>
</tr>
<tr>
<td>Bach</td>
<td>Frank</td>
<td>fbach@yahoo.com</td>
<td>$50.00</td>
<td>http://www.frank.com</td>
</tr>
<tr>
<td>Doe</td>
<td>Jason</td>
<td>jdoe@hotmail.com</td>
<td>$100.00</td>
<td>http://www.jdoe.com</td>
</tr>
<tr>
<td>Conway</td>
<td>Tim</td>
<td>tconway@earthlink.net</td>
<td>$50.00</td>
<td>http://www.timconway.com</td>
</tr>
</table>
functions list
| function | Description |
|---|---|
| setPagerInfo() | set pager info string |
| setPageSize() | set page size |
| setCurrentPage() | set current page number |
| pagerInfo() | get the pager info |
| moveSetPage() | move to assign number page |
| moveCurrentPage() | move to the current page |
| moveFirstPage() | move to the first page |
| moveLastPage() | move to the last page |
| moveNextPage() | move to the next page |
| movePrevPage() | move to the previous page |
Credits
Written by Liao, San-Kai.
Documentation written by Liao, San-Kai, based on Christian Bach great documention.
John Resig for the fantastic jQuery
Donate |
中文