简体   繁体   中英

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
        } );

在此处输入图片说明

You have to set...

"pagingType": "full",

Here you can find all posible combinations...

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

I hope it helps

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
    } );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM