Logeshwaran
Logeshwaran

Reputation: 461

Datatables pagination hide 1 2 3 page button and have Next - Previoud Button ony

I have used datadables.net pagination for my html table. And i want to hide/remove the 1 2 3 ... buttons in pagination and have only Next and Previous Buttons on it.

Is it Possible like doing pagingnumbers: false,(something like this simple change in code) ?

My Function:-

$('#pagination').DataTable( {
            "pagingType": "full_numbers",
            "iDisplayLength": 2,
            "bFilter": false
        } );

enter image description here

Upvotes: 0

Views: 1286

Answers (2)

T L Patel
T L Patel

Reputation: 86

You have 4 options:

simple - 'Previous' and 'Next' buttons only
simple_numbers - 'Previous' and 'Next' buttons, plus page numbers
full - 'First', 'Previous', 'Next' and 'Last' buttons
full_numbers - 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers
So in your case :

 $('#pagination').DataTable( {
        "pagingType": "simple",
        "iDisplayLength": 2,
        "bFilter": false
    } );

Upvotes: 1

A. Iglesias
A. Iglesias

Reputation: 2675

You have to set...

"pagingType": "full",

Here you can find all posible combinations...

https://datatables.net/reference/option/pagingType

I hope it helps

Upvotes: 1

Related Questions