Want className applied to but not to

Want className applied to but not to

msand01msand01 Posts: 54Questions: 24Answers: 1

Hi,
In using the className option with columns like so:

{ data: "Flag", className: "text-uppercase" }

the column header is also affected by the class (in this case its changed to all caps).
Is there a way for the data cells to have the class applied, but not the column header? I can't even seem to remove it with javascript after the fact.

Thank you for any help.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586
    Answer ✓

    Hi @msand01 ,

    If you're adding it with columns.className, as you are, you can remove the class with something like this:

    $('#example thead th:eq(1)').hasClass('fred')
    

    You can also add a class specifically to a row with createRow - the example on that page shows it doing that.

    The callback would avoid the header, but if you have many rows it may be less efficient.

    Cheers,

    Colin

This discussion has been closed.