Using the sScrollX option makes the table ID disappear.

Using the sScrollX option makes the table ID disappear.

CodeWzrdCodeWzrd Posts: 3Questions: 0Answers: 0
edited May 2012 in DataTables 1.9
I noticed that when using the sScrollX option, the table ID (example) disapper.

See the JSFiddle to test it out! http://jsfiddle.net/CodeWzrd/x67vh/3/

The style is not being applied until you comment out sScrollX.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    It's to do with your CSS selector:

    [code]
    #example thead th
    [/code]

    when scrolling is enabled, the table is split up into three individual tables (you can't cross browser, reliably just scroll the TBODY sadly): the header, footer and body. And since only one table can have the #example ID, that is left on the body. So you need to generalise the selector a bit more (.dataTable for example).

    Poking around in Firebug / Inspector might be of interest to see the DOM that DataTables sets up.

    Allan
This discussion has been closed.