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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:00:02+00:00 2026-05-27T05:00:02+00:00

This is my table , use tr, and td. NAME Address CITY STATE ABC

  • 0

This is my table , use tr, and td.

NAME Address CITY STATE 
ABC   123    A     CA 
AB8   123    B     CA
AFC   456    B     TX 
POI   985    C     KJ

After document ready, it will hide all already.

Now I want a line to show all tr have:
-> Column (4) = CA “and” Column (3) = B

I tired my code:

$("table[id=maintablex] tr td:nth-child(4):contains('CA'), table[id=maintablex] tr td:nth-child(3):contains('B')").closest('tr').show();

But it show everything have (4) = CA , and (3) = B… My code was “OR” , can some one help me this one ?

Added FULL HTML CODE:

<table id="table">
    <tr>
        <td>ABC</td>
        <td>123</td>
        <td>A</td>
        <td>CA</td>
    </tr>
    <tr>
        <td>ABC</td>
        <td>1234</td>
        <td>B</td>
        <td>CA</td>
    </tr>
    <tr>
        <td>AUF</td>
        <td>123</td>
        <td>C</td>
        <td>TX</td>
    </tr>
    <tr>
        <td>ABC</td>
        <td>456</td>
        <td>B</td>
        <td>TX</td>
    </tr>
</table>
<script language="Javascript">
$("table[id=table] tr").hide();

// Code show here


</script>

The result I want to show is only :

AB8   123    B     CA
  • 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-27T05:00:03+00:00Added an answer on May 27, 2026 at 5:00 am

    Why not do it this way:

    $("table[id=maintablex] tr td:nth-child(3):contains('B')", 
        $("table[id=maintablex] tr td:nth-child(4):contains('CA')")
    ).closest('tr').show();
    

    I don’t know if this is faster, but based on @Jasper ‘s response, why not do this:

    //select the table, find all `<td>` elements that contain `CA` and iterate through each of them
    $('#table')
        .find('td:nth-child(4):contains("CA")')
        .closest('tr')
        .find('td:nth-child(3):contains("B")')
        .closest('tr')
        .addClass('active');
    

    Here’s the jsfiddle: http://jsfiddle.net/KQMXe/

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

Sidebar

Related Questions

I try to use this mapping : @Entity @Table(name=ecc.\RATE\) @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name=DISCRIMINATOR, discriminatorType= DiscriminatorType.STRING) public
I have a SQL database table with User info - ID, Name, Address, City,
In this table how would I use YQL/Xpath to get all data members of
So I've got this audit table, looks like this: USE [DatabaseName] GO /****** Object:
if i use this query thath creates a table(look Table1), But VisitingGap column is
I use this code to update data in database table. Can reuse same code
What benefits does WCF bring to the table and why should I use this
We have a SQL Server table containing Company Name, Address, and Contact name (among
As an example: SELECT name, address, phone FROM USER; Generates the table name |
How could i use regex to find this table in a page (need to

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.