Hi I am struggling with this. I have tried many of the numerous solutions posted here and elsewhere but cannot seem to get the functionality I need.
I have a fairly simple dynamic webpage which displays tabulated results. I only have a limited amount of freedom over what I can change within the page itself. When one of the links within the table is selected a second page loads which makes the appropriate changes in the database then returns to the first page. I am looking to return to the same position not only on the page itself but also within the scrolling table.
<html>
<body>
<table>
<tr>
<th style="width: 50px;">heading 1</th>
<th style="width: 50px;">heading 2</th>
<th style="width: 50px;">heading 3</th>
<th style="width: 50px;">heading 4</th>
<th style="width: 50px;">heading 5</th>
</tr>
</table>
<table style="overflow-y: scroll;" id="maintable">
<!-- while loop populates second table from db typically ~50 rows -->
<tr>
<td style="width: 50px;"><a href="changeYN.php?link=1">Yes</a></td>
<td style="width: 50px;"><a href="changeYN.php?link=2">Yes</a></td>
<td style="width: 50px;"><a href="changeYN.php?link=3">Yes</a></td>
<td style="width: 50px;"><a href="changeYN.php?link=4">Yes</a></td>
<td style="width: 50px;"><a href="changeYN.php?link=5">Yes</a></td>
</tr>
<!-- end of while loop -->
</table>
</body>
</html>
I have tried to adapt the example given here Refresh Page and Keep Scroll Position but ended up with a huge mess. I also tried the second solution on this page Reload page in same position. Which does seem to affect the scroll position but doesn't seem to reflect the position in the table.