smaller padding-top/-bottom of DataTables

smaller padding-top/-bottom of DataTables

ludwigmludwigm Posts: 9Questions: 6Answers: 1

I like to have smaller padding-top and padding-bottom of the cells of the DataTable. Currently they are 8px, which is too big.
How can I do this.
I created the table with the bootstrap classes table table-striped table-hover table-bordered and initialized the DataTable with

$(document).ready( function () {
            var table = $('#table_id').DataTable({
                order: [1,'asc'],
                pageLength: 7
        } ); 

This question has accepted answers - jump to:


  • colincolin Posts: 14,695Questions: 1Answers: 2,509
    Answer ✓

    You could tweak that in CSS, or perhaps just use the compact style,


  • PareshKumarPareshKumar Posts: 31Questions: 14Answers: 1
    Answer ✓

    Hi @ludwigm,

    Try using class "compact".


  • ludwigmludwigm Posts: 9Questions: 6Answers: 1

    "compact style" is already better, leading to 4px padding. I would like to have it a little smaller though

Sign In or Register to comment.