Adding Class to indivdual cells

Adding Class to indivdual cells

richievcrichievc Posts: 3Questions: 0Answers: 0
edited November 2012 in General
Hi All Hope everyone had a great Thanksgiving

What Im trying to do is iterate through the cells and check the value of the cell if the cells value is 'pending' I want to highlight that cell red or add a class to do so. How can this be done

Tahnks for any feed back Happy Holidays

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Using the jQuery contains selector:

    [code]
    $('td:contains("pending")').addClass('highlight');
    [/code]

    It's slow though (contains looks at the contents of every cell).

    The other option is to use fnCreatedCell which would probably be faster.

    Allan
This discussion has been closed.