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 7494609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:40:01+00:00 2026-05-29T17:40:01+00:00

Been Googling this for over an hour, and getting answers to much more complex

  • 0

Been Googling this for over an hour, and getting answers to much more complex questions but not this simple one, and my Dummies book is no help.

I want to change the background of a row if a particular cell has a value. So:

$('#MyTable tr').each (function(index) {

    $(this).css('background-color', '#FCDCE4');

});

Works fine to change the bg color in every row, but how can I do this only in rows where column 30 has a value? I could probably give my target cell a css class and do it that way, but I’d really rather learn to use jQuery properly (so that I don’t need to keep posting elementary questions).

  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-05-29T17:40:08+00:00Added an answer on May 29, 2026 at 5:40 pm

    Description

    You can use jQuery .children() and .eq() to get the cell 30.

    Note that .eq() is zero based, so you need to use 29 to get the 30th cell

    Sample

    $('#MyTable tr)').each (function(index) {
        var cell = $(this).children("td").eq(29)
    
        // your if condition
    
        $(this).css('background-color', '#FCDCE4');
    });
    

    More Information

    • jQuery – .eq()
    • jQuery – children()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may be a simple question, but I have been Googling for over an
I've been googling this one a lot but I still could not make it
This sounds stupidly easy, however I've been googling for over an hour and I
I've been searching an googleing over one hour now and I'm not really sure
I have been googling this one fervently, but I can't really narrow it down.
I've been googling this one and haven't turned up anything useful: Assuming you use
Does anybody know whether one exists? I've been googling this for monthes... Thanks
What exactly is the scope of an HTTP session? I've been googling this but
I've been googling this question, but haven't been able to find an answer. I
I've been Googling this for hours, but with no luck. I'm using standard c,

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.