JQuery Datatables row height

后端 未结 2 1046
一整个雨季
一整个雨季 2021-01-18 02:21

I have a page where people can enter in first/last name, phone, email, and ethnicity click add and it adds an entry into the datatables. The problem is after clicking add th

2条回答
  •  天命终不由人
    2021-01-18 02:57

    This is an old question, but if like me you don't want to do this in CSS you can use drawCallback in 1.10 or higher to alter the table cell padding and/or height using JS.

    var import_list = $( 'table.import_list' ).DataTable( {
        'drawCallback': function () {
            $( 'table.import_list tbody tr td' ).css( 'padding', '5px 8px 5px 8px' );
        }
    } )
    

提交回复
热议问题