DataTables 1.9.4 CSS Not Being Applied ?

DataTables 1.9.4 CSS Not Being Applied ?

tomrowetomrowe Posts: 3Questions: 0Answers: 0
edited January 2013 in DataTables 1.9
Hi,

Firstly as this is my first ever post here I would like to say what an absolutely outstanding piece of work DataTables is.

My problem is that I have a DataTable that works perfectly using DataTables 1.9.1 however when I upgrade it to using DataTable 1.9.4 some of the CSS is not being applied, i.e. specifically...

table.dataTable thead th
table.dataTable tfoot th

table.dataTable tr.odd
table.dataTable tr.even
table.dataTable tr.odd td.sorting_1
table.dataTable tr.odd td.sorting_2
table.dataTable tr.odd td.sorting_3
table.dataTable tr.even td.sorting_1
table.dataTable tr.even td.sorting_2
table.dataTable tr.even td.sorting_3

I am using exactly the same CSS file I created for the working DataTable using 1.9.1 and don't understand why this is not being applied ? Maybe something has changed between DataTables 1.9.1 and 1.9.4 in the way CSS is applied that I am unaware of, and I need to change my CSS or HTML Table classes ?

Any help would be very much appreciated unfortunately I can't post a link to the page as it is residing on my companies intranet :o(

Regards,

Tom Rowe

Replies

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    I don't understand why that isn't working either I'm afraid. I'm not aware of any breaking changes (there shouldn't have been any!). It looks to be that it should. I'd need a link to ascertain why it isn't working I'm afraid. I'd suggest using Firebug / Inspector to discover why it isn't being applied.

    Allan
  • tomrowetomrowe Posts: 3Questions: 0Answers: 0
    Hi Allan,

    FYI I managed to get the table working by applying class dataTable to the tag, previously I only had display assigned as per...

    http://www.datatables.net/blog/Getting_started_with_DataTables%3A_First_steps

    It appears from the following that this class was applied automatically in 1.9.1 but not in 1.9.4 ?

    Original mark up with class="display"...




    Broken CSS 1.9.4 class dataTable is not assigned automatically if not declared in the table HTML mark up...



    Working CSS 1.9.1 class dataTable is assigned automatically if not declared in the table HTML mark up...



    Regards,

    Tom Rowe
  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    > It appears from the following that this class was applied automatically in 1.9.1 but not in 1.9.4 ?

    No - DataTables has never automatically added the 'display' class, however it was in a lot (all?) of my examples. It does however add `dataTable` class automatically now, and that should be the primary class used to identify a DataTable.

    Allan
  • tomrowetomrowe Posts: 3Questions: 0Answers: 0
    Hi Allan,

    Regarding..

    It appears from the following that this class was applied automatically in 1.9.1 but not in 1.9.4 ?

    I was not referring to the 'display' class here (which I had in my original HTML markup as per the examples), but that fact that I had to add the 'dataTable' class manually to get things to work in 1.9.4. So it appears to me that the 'dataTable' is not being added automatically now as it was previously in 1.9.1 ?

    Regards,

    Tom Rowe
  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    Seems to work just fine here: http://datatables.net/release-datatables/examples/basic_init/zero_config.html

    Allan
This discussion has been closed.