The class option no longer applies to TH cells in thead

The class option no longer applies to TH cells in thead

redfellowredfellow Posts: 5Questions: 2Answers: 0

Link to test case: https://live.datatables.net/xecaxaxa/1/edit
Description of problem: I'm migrating from DataTables 1.x and noticed that the class option no longer applies to thead cells. Can this be achieved somehow with 2.x?

Replies

  • kthorngrenkthorngren Posts: 20,401Questions: 26Answers: 4,787

    I don't see an option columns.class in the docs so not sure what is expected. There is a columns.className that applies the class to the thead, tbody and tfoot. Updated test case:
    https://live.datatables.net/xecaxaxa/2/edit

    Kevin

  • redfellowredfellow Posts: 5Questions: 2Answers: 0

    Ah, maybe the "class" option is something old and deprecated. It did work in my test case for tbody and it worked for both in 1.x.

    I'll update my code

  • allanallan Posts: 61,920Questions: 1Answers: 10,153 Site admin

    Ah - class would have worked as a happy accident because of the Hungarian notation sClass from way back in the day. The translator will have picked up class as a match for that. Mildly surprised that it has changed for 2, but yes, use columns.className.

    Allan

Sign In or Register to comment.