0

I use the following code to move (after the user click) to the specific part of the page:

<a class="text-link font-weight-bold" href="#employees">See the list of employees</a>

So the table in the bottom of my page looks like this:

<table id="employees" ...>
...
</table>

However, this always moves the user so that he can't see the top of the table, until he scrolls a bit. Is there any way to say that I want to move to this table and add x pixels to that distance?

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
enneenne
  • 209
  • 1
  • 8
  • Could you get away with a negative margin on #employees ? – spirift Feb 11 '21 at 15:54
  • Does this solve your problem? https://stackoverflow.com/questions/10732690/offsetting-an-html-anchor-to-adjust-for-fixed-header?noredirect=1&lq=1 – Alex Berger Feb 11 '21 at 15:54
  • Check [this thread](https://stackoverflow.com/questions/49820013/javascript-scrollintoview-smooth-scroll-and-offset) I think it might be able to help. – Damon Feb 11 '21 at 15:55
  • Does this answer your question? [offsetting an html anchor to adjust for fixed header](https://stackoverflow.com/questions/10732690/offsetting-an-html-anchor-to-adjust-for-fixed-header) – Heretic Monkey Feb 11 '21 at 15:58
  • You can just add additional padding/margin on top to move your content to be visible. Or possible create a container and add the padding/margin on it. – MarLMazo Feb 11 '21 at 16:15

0 Answers0