dataTables assigning a css class to the pagination wrapper

前端 未结 2 1597
囚心锁ツ
囚心锁ツ 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条回答
  •  -上瘾入骨i
    2021-02-20 06:27

    You can use drawCallback option:

    $(document).ready(function () {
        $('#myDataTable').DataTable({
            ...
            "drawCallback": function () {
                $('.dataTables_paginate > .pagination').addClass('pagination-sm');
            }
        });
    });
    

提交回复
热议问题