Highlight specific rows

Highlight specific rows

rockyyyrockyyy Posts: 4Questions: 0Answers: 0
edited February 2013 in General
i am using tablepress plugin on my wordpress website which uses datatables. i have a requirement of highlighting specific rows. my table will be constantly updated and it will always be arranged in the ascending order of the "name" entry. what would be the easiest way to highlight the rows?
as of now i am using this command
[code]
.tablepress-id-14 .row-368 td {
background-color: #CCFF99;
}
[/code]
but the problem i am facing with this is that i manually need to highlight each entry. and moreover if i add a new entry which falls somewhere in the middle of the table (ascending order) it will change the row ids of the rows below and the wrong rows will be highlighted.

i have entered "***" in a field in each row that i want to be highlighted. is there any way to highlight rows only which have *** in them

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Not via pure CSS - you'd need to loop over the table contents and add a class to the rows which have your `***` in them.

    Allan
  • rockyyyrockyyy Posts: 4Questions: 0Answers: 0
    @allan could you please explain in detail
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    edited February 2013
    Yes - use fnGetNodes (or the $ API method) to get the cells in the table, and then check the contents of each (with jQuery's text() or html() options). If you find what you are looking for, then add a class to the row.

    Another option, if the data isn't going to change is to use fnCreatedRow in a similar manner - it will be faster.

    Allan
  • rockyyyrockyyy Posts: 4Questions: 0Answers: 0
    i cant understand any part of this nor do i have any idea about it coz i am not a coder. i was just looking for a solution and was directed here by one of my friends.
    could you please help do the required stuff. i would be more than thankful
    my skype - dwrockyyy
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Certainly - I think the 1 hour support option would cover the work that is required: http://datatables.net/support .

    Allan
  • rockyyyrockyyy Posts: 4Questions: 0Answers: 0
    way too expensive for me. my whole website setup did not cost me that much. if i knew finding a solution for this would cost me so much i would have stuck to manually doing the work.
    anyways thanks alot for your help. appreciate it.
This discussion has been closed.