Pagination is used to separate the content into discrete pages that is short and easy to understand. Materialize CSS provide classes to create a pagination bar that holds the links to the other pages.
The pagination class is used to set the <ul> list element as a pagination component. The pages that have to be shown are defined inside this component as <li> items. A left and right arrow icon can be used to show the buttons for moving to the next or previous page.
Syntax:
<ul class="pagination">
<li class="disabled">
<a href="#!">
<i class="material-icons">
chevron_left
</i>
</a>
</li>
<li class="active">
<a href="#!">1</a>
</li>
<li class="waves-effect">
<a href="#!">2</a>
</li>
<li class="waves-effect">
<a href="#!">3</a>
</li>
<li class="waves-effect">
<a href="#!">
<i class="material-icons">
chevron_right
</i>
</a>
</li>
</ul>
Example:
HTML
<html>
<head>
<meta name="viewport" content=
"width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href=
<link rel="stylesheet" href=
<script type="text/javascript" src=
</script>
<script src=
</script>
</head>
<body>
<div class="card-panel">
<h3 class="center">
Pagination
</h3>
<ul class="pagination center-align">
<li class="disabled">
<a href="#!">
<i class="material-icons">
chevron_left
</i>
</a>
</li>
<li class="waves-effect">
<a href="#!">1</a>
</li>
<li class="active green">
<a href="#!">2</a>
</li>
<li class="waves-effect">
<a href="#!">3</a>
</li>
<li class="waves-effect">
<a href="#!">4</a>
</li>
<li class="waves-effect">
<a href="#!">5</a>
</li>
<li class="waves-effect">
<a href="#!">
<i class="material-icons">
chevron_right
</i>
</a>
</li>
</ul>
</div>
</body>
</html>
|
Output:
