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>

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

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.