JQuery Datatables row height

后端 未结 2 1013
一整个雨季
一整个雨季 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' );
        }
    } )
    
    0 讨论(0)
  • 2021-01-18 03:05

    As you can see in this fiddle your code is correct and should work as expected.

    In any case to set a row height, simply use css

     tr { height: 50px } 
    

    i think there is no need for it to be more complex.

    Regarding the question on how to insert the data into a db, there are tons of examples on google.

    0 讨论(0)
提交回复
热议问题