Basic datatable
The DataTablesis a highly flexible tool, based upon the foundations of progressive enhancement, and will add advanced interaction controls to any HTML table. DataTables has most features enabled by default, so all you need to do to use it with your own tables is to call the construction function. Searching, ordering, paging etc goodness will be immediately added to the table, as shown in this example. Datatables support all available table styling.
Pagination types
The default page control (forward and backward buttons with up to 7 page numbers in-between) is fine for most situations, but in some cases you may wish to customise the options presented to the end user. This is done through DataTables' extensible pagination mechanism, the pagingTypeoption. Supported pagination types are: simple, simple_numbers, fulland full_numbers. This example shows simplepagination type.
State saving
DataTables has the option of being able to save the stateof a table: its paging position, ordering state etc., so that is can be restored when the user reloads a page, or comes back to the page after visiting a sub-page. This state saving ability is enabled by the stateSaveoption. The durationfor which the saved state is valid can be set using the stateDurationinitialisation parameter (2 hours by default).
Scrollable datatable
This example shows the DataTables table body scrollingin the verticaldirection. This can generally be seen as an alternative method to pagination for displaying a large table in a fairly small vertical area, and as such pagination has been disabled here. Note that this is not mandatory, it will work just fine with pagination enabled as well!.