Is it possible to disable CSS Styling applied by DataTables.

Is it possible to disable CSS Styling applied by DataTables.

salman_kagzisalman_kagzi Posts: 12Questions: 0Answers: 0
edited April 2012 in DataTables 1.9
I am using DataTables to along with ColVis and TableTools plugins to achieve export and Column Visibility feature in one of my tables.
Is it possible to Turn Off CSS Styling classes that are attached by DataTables to the Table for which its initialized.

My table already has some legacy styling which is not supposed to be changed. Some of the DataTables styling overrides them, I wan to disable this without having to make changes to DataTables CSS files, as I intend to use them for Other Tables in my application.

Can this be achieved via some Configuration?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You could simply not include the DataTables CSS files? Or make sure you include jquery.dataTables.css which has minimal styling information - but if you want to edit the styles, you need to do just that :-)

    Allan
  • salman_kagzisalman_kagzi Posts: 12Questions: 0Answers: 0
    Thanks. That worked. (Had to change some padding related styles though in jquery.dataTables.css)

    Another quick question. (Let me know if I should start a new Discussion for this.)
    I am also using Fixed Headers on this Same table. Now the table HTML is loaded via ajax and depends on some Select and Checkbox values. As the values change the table is reloaded.

    With the First load the Fixed header works fine, with the next load old header would remain and a new one would also come in. After some digging in, i found that Fixed header was creating a cone of the Header from the first table and thought that deleting this div would fix the problem. But it didn't :(

    Was wondering if there is any way around this?
This discussion has been closed.