Highlighting certain rows

Highlighting certain rows

mettlusmettlus Posts: 2Questions: 0Answers: 0
edited March 2011 in General
I have a table which has dates in them, based on certain date maths I have to highlight that row, how can i achieve with datatables?
TIA

Replies

  • 28.vivek.s28.vivek.s Posts: 69Questions: 0Answers: 0
    edited March 2011
    i think dataTable can't help you in this case...you have to play with jQuery.

    regards,
    Vivek
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    edited March 2011
    Hi mettlus,

    You can use fnRowCallback to do conditional formatting of rows. Here is an example where I've set the CSS grade in my demo data to be bold when it is grade A: http://www.datatables.net/examples/advanced_init/row_callback.html . In the case you are looking at you could use your date calculation logic to decide if a class should be added or removed from the row.

    Regards,
    Allan
  • mettlusmettlus Posts: 2Questions: 0Answers: 0
    @allan Thanks a lot
    @Vivek, yeah thats how I did it with my old html tables
This discussion has been closed.