Code Monkey home page Code Monkey logo

materialize_table_pagination's Introduction

materializecss-table-pagination

Plugin to paginate html tables, using materializecss.

Since the original repository is no longer being updated and its JS support is already broken and deprecated, I thought it could be beneficial to release an updated and tweaked version of the library. Works great in coordination with MaterializeCSS.

Basic Usage

Import all css and js dependencies

<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!--Import jquery.css-->
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<!--Import materialize.js-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<!--Import pagination.js this is the plugin-->
<script type="text/javascript" src="js/pagination.js"></script>

If you have a table named myTable, initialize the table with:

$(document).ready(function(){
	$('#myTable').pageMe({
	  pagerSelector:'#myPager',
	  activeColor: 'green',
	  prevText:'Anterior',
	  nextText:'Siguiente',
	  entriesRecordedText: 'entries recorded',
	  showPrevNext:true,
	  hidePageNumbers:false,
	  perPage:10
	});
});

Options

pagerSelector:'#myPager',                // the name of the materialize pager
activeColor: 'green',		         // color of the active page
prevText:'Previous',		         //  'previous page' text
nextText:'Next',                         //  'next page' text
entriesRecordedText: 'entries recorded', // '%s entries recorded' text
showPrevNext:true,                       // show previous and next buttons
hidePageNumbers:false,                   // hide page numbers
perPage:10			         // number of rows to show

Demo

View pagination.html to see the code to use pagination plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.