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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:59:03+00:00 2026-05-15T18:59:03+00:00

I want each cell in my table (excluding headers and has to be a

  • 0

I want each cell in my table (excluding headers and has to be a number) to link to a URL which is formed using the position of the cell, i.e. the cell number and column number of it.

E.g. a cell will link to example.com/hello.html?column=1&row=3

Ideally this would be done with jQuery…unless there is a better way? I can’t easily alter the PHP code that is generating the table, so I think it will have to be browser-side.

I’ve had a look at datatables and its api call fnGetPosition but am unsure how to convert this into a link which operates on every numerical cell that isn’t the first row or column.

  • 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-15T18:59:04+00:00Added an answer on May 15, 2026 at 6:59 pm

    The answer, as far as jQuery is concerned, lies within .index()

    Given the following html:

    <table>
        <tr>
            <td>Test</td>
            <td>Test</td>
            <td>Test</td>
            <td>Test</td>
        </tr>
            <tr>
            <td>Test</td>
            <td>Test</td>
            <td>Test</td>
            <td>Test</td>
        </tr>
        <tr>
            <td>Test</td>
            <td>Test</td>
            <td>Test</td>
            <td>Test</td>
        </tr>
    <table>
    

    The jQuery would look like this:

    $('tr td').each( function() {
        var colNum = $(this).index();
        var rowNum = $(this).parent().index();
        $(this).wrap('<a href="example.com/hello.html?column=' + colNum + '&row=' + rowNum +'">');
    })
    

    A working example here – http://jsfiddle.net/NDpCa/3/

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

Sidebar

Related Questions

I want to get each cell value from an HTML table using JavaScript when
I have a table of data and each cell is a link. I want
I want to creat an UITableView which each cell (UITableCell) in this table can
I've a problem. I want to create a table view in which each cell
I have a table view where I want a different image for each cell
I've a table view. In each cell (row), i want to show two buttons.
I have multiple html tables. Each table has the same number of columns but
I want to create a really easy to use 2D Grid. Each cell in
I want every cell in each row except the last in each row. I
I want to process each source code file after it has been preprocessed: myprocess

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.