Custom class for cell based on cell contents?

Custom class for cell based on cell contents?

DaveBurnsDaveBurns Posts: 17Questions: 0Answers: 0
edited December 2011 in General
I'm using version 1.8.2. I'd like a way to change a specific TD's class (or add rather than change) based on the cell's contents. The use case is that I have a column with values Y or N and I'd like all N values to show in red. I think I'm looking for something like fnRender that would let me return a class name but I don't see it. Is there an existing way to do this?

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    edited December 2011
    DataTables 1.9 introduces a new option called fnCreatedCell ( http://datatables.net/docs/DataTables/1.9.beta.1/DataTable.defaults.columns.html#fnCreatedCell_details ) which sounds perfect for this :-). 1.9 is currently in beta - final release should be in 2-3 weeks but is quite stable for use just now.

    Allan
  • DaveBurnsDaveBurns Posts: 17Questions: 0Answers: 0
    Sounds good. Thanks, Alan.
This discussion has been closed.