Row Height

Row Height

andyskandysk Posts: 13Questions: 2Answers: 0

Is it possible to set the row height of each row?
ex. in http://www.datatables.net/examples/basic_init/zero_configuration.html , there is a lot of spaces between each row, I am trying to make more compact. Thanks

This question has an accepted answers - jump to answer

Answers

  • AshbjornAshbjorn Posts: 55Questions: 2Answers: 16
    edited July 2015 Answer ✓

    Hi andysk,

    There are several ways to deal with this, personally I would just use CSS to achieve the result:

    Have all of your DataTables affected:

    table.dataTable tbody th, table.dataTable tbody td {
        padding: 8px 10px; /* e.g. change 8x to 4px here */
    }
    

    Only have one specific DataTable affected:

    ##example tbody th, ##example tbody td {
        padding: 8px 10px; /* e.g. change 8x to 4px here */
    }
    

    Note: I added an extra # in the CSS to prevent the site from displaying weird links.

    Also make sure this CSS (or if it is in your file) is loaded last so it actually acts as an override.

    Hope this helps,

  • andyskandysk Posts: 13Questions: 2Answers: 0

    Hi Ashbjorn... thanks.. straight to the point

This discussion has been closed.