Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 170731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:51:40+00:00 2026-05-11T12:51:40+00:00

I have the following table: <table class=grid> <thead> <tr> <th>Name</th> <th>Status</th> <tr> </thead> <tbody>

  • 0

I have the following table:

<table class='grid'>     <thead>         <tr>             <th>Name</th>             <th>Status</th>         <tr>     </thead>     <tbody>         <tr>             <td>Project 1</td>             <td>Closed</td>         <tr>         <tr>             <td>Project 2</td>             <td>Open</td>         <tr>         <tr>             <td>Project 3</td>             <td>Closed</td>         <tr>     </tbody> </table> 

I am trying to move some of my UI code that I used to do in the code-behind to jQuery. I would like to change the class of TR element whenever the Status (Column 2) column has a value of Open.

What would be the best approach to doing this with jQuery?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:51:40+00:00Added an answer on May 11, 2026 at 12:51 pm
    $('tbody > tr', 'table.grid').filter(function() {     return $(this).children('td').eq(1).text() == 'Open'; }).addClass('open_tr'); 

    What it is doing:

    It is selecting all the <tr> elements inside the <tbody> of the table.grid context. The filter function allows you to filter elements based on what you return, either true to keep or false to discard. So inside the filter we get all the children of the tr, get the 2nd <td>, and return whether or not its text is equal to ‘Open’ – if it is, it would return true, and we could keep the parent <tr> in the selector. All that is left would then just be <tr> with Open status, so we can add a class to mark them as such.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following entity class : @Entity @Table(name = THE_TREE, catalog = ,
I have the following mapping: @Entity @Table(name = Prequalifications) public class Prequalification implements Serializable
I have the following mapping for my table in MySql: <class name=Tag, namespace table=tags
I have an entity mapped as following: @Entity @Table(name = Groups) @IdClass(value = GroupId.class)
I have the following class: @Entity @Table(name=tbl_books) public class Book{ private int id_book; private
I have the following two tables and jQuery: <table class=grid /> <table class=grid custom
I have the following table where teachers class routine are stored Table Name: batchroutine_regular
I have the following database table object: public class Goal { @DatabaseField(generatedId = true)
I have the following code in my context, and no explicit table-class mapping, yet
I have a webpage including the following div: <div class='book_box'> <table border=0 cellspacing=0> <tr>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.