How can I make my topbar buttons ‘sticky’?

I have some code that renders Pytest test run results as an HTML page. I’m somewhat satisfied with it for now, except I’d like to make the top “navbar” sticky (it’s actually made up of buttons). Maybe I’m calling for help too earl, but I’ve been looking at it for some time, and I just kind of need something that’s working witin the constraints of my existing code before I eventually go back and refactor it all. Can anyone take a look and hopefully see how I can achieve this, without compromising the other areas of the code?

I had gotten something working before, but it trashed the functionality of the other content, so I backed it out.

I can’t post all the code because it’s too large, but SO wants me to post somteihng that looks like code, so here we have it before the link to the JS Fiddle down below.

for _ in range(10):
    print(_)

Disclaimer: I’m a total hack at front end coding. I know there are probably all sorts of violations in my code that will make real front end devs shudder – but here it is anyway:

https://jsfiddle.net/JavaJeff13/bgh72jw5/7/

P.S. Yes I am aware that Pytest-HTML already does something very similar. 🙂