为分页包装器分配css类的dataTables [英] dataTables assigning a css class to the pagination wrapper

查看:56
本文介绍了为分页包装器分配css类的dataTables的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个dataTable及其最基本的初始化代码.但是,我需要为自定义的分页CSS类分配给出现在表底部的分页(我想为Twitter引导分页类分配).我该怎么办?

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 to assign Twitter bootstrap pagination class). How should I do this?

这是我的代码:

$(document).ready(function() {
                        /* Build the DataTable with third column using our custom sort functions */
                        $('#list_table').dataTable({"sPaginationType" : 'full_numbers', 'sPaging' : 'pagination'});

                    } );

推荐答案

您可以使用drawCallback选项:

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

这篇关于为分页包装器分配css类的dataTables的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆