dataTables assigning a css class to the pagination wrapper

前端 未结 2 1587
囚心锁ツ
囚心锁ツ 2021-02-20 05:31

I have a dataTable with it most basic initialization code. But, I need to assign a custom pagination css class to the pagination which appears at the bottom of the table (i want

相关标签:
2条回答
  • 2021-02-20 06:25

    use .addClass() method:

    $('yourpager').addClass('yourTwitterbootstrappaginationclass');
    
    0 讨论(0)
  • 2021-02-20 06:27

    You can use drawCallback option:

    $(document).ready(function () {
        $('#myDataTable').DataTable({
            ...
            "drawCallback": function () {
                $('.dataTables_paginate > .pagination').addClass('pagination-sm');
            }
        });
    });
    
    0 讨论(0)
提交回复
热议问题