Demo at http://www.minjs.com/#longtable
- paging
- minimal code
- all controls rendered inside the table itself (currently the
<tfoot>
) - no library dependencies
var yourTable = document.getElementById('yourTable');
longtable(yourTable);
longtable()
takes an options argument as an optional second argument. The options are:
perPage
: how many rows to display per page (default: 10)startPage
: which page to display initially (default: 1)maxPageLinks
: how many page navigation links to display (default: 9)
Longtable will display fewer than maxPageLinks
page navigation links if there are fewer pages. For best results, use an odd numbered maxPageLinks
greater than equal to 3.
longtable(yourTable, {perPage: 20, maxPageLinks: 7});
gotoPage(n)
- jump to the given page number
yourTable.gotoPage(3);
longtable.pageChange
- triggered when the page changes (passes the page number)
- Rows to be paged must be in the
<tbody>
. - Does not support adding/removing table rows.
- Internet Explorer <= 8