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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:03:04+00:00 2026-06-13T13:03:04+00:00

My table cell gets highlighted when clicked. I need to find the rowIndex of

  • 0

My table cell gets highlighted when clicked. I need to find the rowIndex of highlighted cell.
I tried doing like this

$(".ui-state-highlight").index(); // Results to 0

I tried this too…

$('td').click(function(){

    var row_index = $(this).parent().index('tr');

    var col_index = $(this).index('tr:eq('+row_index+') td');

    alert('Row # '+(row_index)+' Column # '+(col_index));

}); 
// Results : Row # -1 Column # -1

I went to through this post and tried the first answer, still couldn’t get the result.

  • 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-13T13:03:05+00:00Added an answer on June 13, 2026 at 1:03 pm

    Try this,

    $('td').click(function(){
       var row_index = $(this).parent().index();
       var col_index = $(this).index();
    });
    

    If you need the index of table contain td then you can change it to

    var row_index = $(this).parent('table').index(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When a table cell is selected it gets highlighted in a blue color. I'd
I have a table cell (td) that triggers a script when clicked. I have
I have items in a table cell that gets toggled on and off. An
This code gets the text that's in a certain column of a table row:
I would like to have a form that gets output into a table. The
I have this javascript, jquery function, (below) It gets the text inside each table
I would like to add a link button control to a table cell, server
CREATE TABLE #Report( Cell int, CellValue double) Error here DECLARE @Report TABLE ( Cell
I'm building a table cell using two bound ember.js views on data. When I
I have a table cell that isn't entirely filled with text so the bg

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.