# Pagination.js > A jQuery plugin to provide simple yet fully customisable pagination. [![Bower version][bower-image]][bower-url] [![CDNJS](https://img.shields.io/cdnjs/v/paginationjs.svg)](https://cdnjs.com/libraries/paginationjs) [bower-url]:http://badge.fury.io/bo/paginationjs [bower-image]: https://badge.fury.io/bo/paginationjs.svg paginationjs See demos and full documentation at official site: [http://paginationjs.com](http://pagination.js.org) # Installation / Download `bower install paginationjs` or just download [pagination.js](dist/pagination.js) from the git repo. # Quick Start ```html
``` ```js $('#pagination-container').pagination({ dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 195], callback: function(data, pagination) { // template method of yourself var html = template(data); $('#data-container').html(html); } }) ``` # Rendering data Below is a minimal rendering method: ```js function simpleTemplating(data) { var html = ''; return html; } ``` Call: ```js $('#pagination-container').pagination({ dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 195], callback: function(data, pagination) { var html = simpleTemplating(data); $('#data-container').html(html); } }) ``` To make it easier to maintain, you'd better use specialized templating engine to do that. Such as [Handlebars](http://handlebarsjs.com/) and [Undercore.template](http://underscorejs.org/#template). ### Handlebars ```html ``` ```js $('#pagination-container').pagination({ dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 195], callback: function(data, pagination) { var html = Handlebars.compile($('#template-demo').html(), { data: data }); $('#data-container').html(html); } }) ``` ### Underscore ```html ``` ```js $('#pagination-container').pagination({ dataSource: [1, 2, 3, 4, 5, 6, 7, ... , 195], callback: function(data, pagination) { var html = _.template($('#template-demo').html(), { data: data }); $('#data-container').html(html); } }) ``` Or any other templating engine you prefer. # License Released under the MIT license. MIT: [http://rem.mit-license.org](http://rem.mit-license.org/), See [LICENSE](/LICENSE)