Jump to content

Returning to same table row after page reload


gevensen

Recommended Posts

Is there a way to return to the same table row after the page reloads

 

I have created a bank statement reconciliation table

 

If the user click to edit the line item when it returns to that page I would like it to return to the same table row

 

any pointers in the right direction?

 

I have look at anchor tags but i dont want to have to click on anything

 

we are talking a standard html table here

 

<table> 
<tr><td> row1 </td> </tr>
<tr><td> row2 </td> </tr>
<tr><td> row3 </td> </tr>
<tr><td> row4 </td> </tr>
<tr><td> row5 </td> </tr>
<tr><td> row6 </td> </tr>
</table>

Link to comment
Share on other sites

I don't get what you mean, what would they edit on a statement ? Do you mean like for example data in a table they then click edit and then save the data? If so does it have to go to another page or couldn't they just edit it on the page? Couldn't you get the data to post in a <textarea> then they just update the table? Correct me if I'm not getting you

Link to comment
Share on other sites

You need to add an <a> tag to each row of your table, and give it a unique identifier. Then you can add a hash mark with that unique identifier to the URL. That will bring the user to that row. Ex:

 

HTML:

<table>
  <tr>
    <td><a name="row1"></a>This is row one</td>
  </tr>
  <tr>
    <td><a name="row2"></a>This is row two</td>
  </tr>
  <tr>
    <td><a name="row3"></a>This is row three</td>
  </tr>
</table>

URLs:

http://www.site.com/page.html#row1
http://www.site.com/page.html#row2
http://www.site.com/page.html#row3

Those three URLs will take the user to the respective row.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.