DataTables logo DataTables

Is it possible to change the content of a sortable header cell?
  • On my sortable columns I want to replace the column text with a html-button.

    Doing this:

    $( oSettings.aoColumns[i].nTh).text();

    I can retrieve the cell text of the respective column, which I'm using as my button text.

    However doing this:

    $( oSettings.aoColumns[i].nTh).text("some text");
    $( oSettings.aoColumns[i].nTh).html("<a href='#'>some text</a>");

    does not do anything :-(

    Is it possible at all to modify the content of a sortable header cell? Some pointers would be really helpful.

    Thanks!
  • Found it using the fnHeaderCallback function. Great!
This discussion has been closed.
All Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Support

Get useful and friendly help straight from the source.