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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:53:48+00:00 2026-06-15T19:53:48+00:00

I have this table , for which, for each row of it, I want

  • 0

I have this table, for which, for each row of it, I want to select the second td. I know the easiest way, (or at least one way) to do this, is use each() and loop for all tr and select/store the second td in some variable, inside the each loop.

But I was thinking if there could be a direct pseudo code that could help me do this direct without any kinda loop, may it be each() or whatever.

When I do this..

$('#ctl00_ContentPlaceHolder1_grdSelectedCloth > tbody > tr > td')

It gives me all td(s) (near about 40, 8 rows, 5 cols each)

when I do this..

$('#ctl00_ContentPlaceHolder1_grdSelectedCloth > tbody > tr > td:odd')

It gives me half td(s) the odd ones,

when I do this

$('#ctl00_ContentPlaceHolder1_grdSelectedCloth > tbody > tr > td:even')

Again, same it gives me 20 td(s), the even one.

but when I do this

$('#ctl00_ContentPlaceHolder1_grdSelectedCloth > tbody > tr > td:2')

It says Syntax error, unrecognized expression: unsupported pseudo: 2

But when I do this..

$('#ctl00_ContentPlaceHolder1_grdSelectedCloth > tbody > tr > td:eq(2)')

It only shows one td??? And just for the first row, I mean, if I apply pseudo code :odd or :even, it gives the td(s) for all rows, but when I do :eq(2) it gives the second td for only the first row???
So, how can I get second td for all rows, preferably by not using each or any kind of loop but by using some sort of pseudo code?

ps: I was running this in firefox console, just in case are wondering what says “Syntax error, unrecognized expression: unsupported pseudo: 2”?

  • 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-06-15T19:53:49+00:00Added an answer on June 15, 2026 at 7:53 pm

    Try this:

    $('#ctl00_ContentPlaceHolder1_grdSelectedCloth tr td:nth-child(2)');  // would select all cells that are in the 2nd column
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this JSF table which is used to display data. I want to
I have a table which looks like this one: | id | fk_book |
I have this query to select a row from table:- select identifier, name from
I have this query which returns all rows from a table: select Cost, Name,
I have a table with multiple rows, each row has: layout (select) images *
I have this mysql table called comments which looks like this: commentID parentID type
I have this table, which can be seen as a basic custom gantt chart:
I have a product table which simplifies to this: create table product(id int primary
I have a table which have schema like this id name 1 jack 2
I have a table which looks like this: mysql> SHOW COLUMNS FROM Users; +------------+--------------+------+-----+---------+----------------+

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.