DataTables 1.9.4 CSS Not Being Applied ?

DataTables 1.9.4 CSS Not Being Applied ?

edited January 2013 in DataTables 1.9 Posts: 3
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

  • Posts: 22,397
    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
  • Hi Allan,

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

    http://www.datatables.net/blog/Getting_started_with_DataTables:_First_steps

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

    Original <table> mark up with class="display"...

    <div class="DataTables_Container" style="padding-bottom:0px; padding-top:0px;">
    <table cellpadding="0" cellspacing="0" border="0" class="display" id="Data_Table" width=100%>

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

    <table width="100%" class="display" style="width: 1384px; margin-left: 0px;" border="0" cellSpacing="0" cellPadding="0">

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

    <table width="100%" class="display dataTable" aria-describedby="table_id_info" style="width: 1350px; margin-left: 0px;" border="0" cellSpacing="0" cellPadding="0">

    Regards,

    Tom Rowe
  • Posts: 22,397
    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
  • 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
This discussion has been closed.