Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement request: make the table headers stay on the page #14

Open
PenelopeFudd opened this issue Oct 10, 2013 · 4 comments
Open

Enhancement request: make the table headers stay on the page #14

PenelopeFudd opened this issue Oct 10, 2013 · 4 comments

Comments

@PenelopeFudd
Copy link

I'm really enjoying NYTProf, it's a great tool!

One problem I'm having is that I can't remember what the columns are in the various reports, and so I tend to have to scroll up to the top to figure it out. Would it be possible to make the table headers stay at the top of the screen, and not scroll off the top? It's probably going to be a CSS solution, but failing gracefully on browsers without CSS is what CSS does! :-)

Thanks!

@ghost
Copy link

ghost commented Oct 6, 2016

Hello everyone,

You'd need some JavaScript to accomplish this. Since JQuery is used in nytprofhtml already, how about http://mkoryak.github.io/floatThead/# ??

Problem is, this repo seems to be a bit outdated. The nytprofhtml version on debian testing has a higher version number than the code here (6.03 vs 6.02). So how could one possibly contribute?

@timbunce
Copy link
Owner

timbunce commented Oct 7, 2016

The nytprofhtml version on debian testing has a higher version number than the code here (6.03 vs 6.02).

Oh, thank you! I'd simply forgotten to push after the last release. Then to complicate matters I'd merged a PR via the github UI recently.

I've resolved that by doing a force push, so the repo matches what was released, and then remerging the PR manually. So the repo is back in a good state now (though it might complicate life for anyone who has pulled recently).

So how could one possibly contribute?

I'd be delighted if you could help with the table headers, and anything else for that matter :)

@ghost
Copy link

ghost commented Oct 10, 2016

@PenelopeFudd Could you checkout https://github.com/SebastianRose/devel-nytprof/tree/14-table-headers-stay-on-top an see how it works for you? In recent browsers it's fine - apart from a little bug in floutHeaders not taking URL-fragments into account. I'll deal with that one these days... I have Opera, Firefox, IE available for testing. After upgrading to a more recent Opera version everything works just fine for me.

@anall
Copy link

anall commented Jan 18, 2022

If we're okay with this enhancement only working in somewhat modern browsers, we should just be able to add style="position: sticky; top: 0;" to the header-row <tr>s

According to MDN, this is supported in Safari since 2019, and all other desktop browsers (besides IE) since 2017.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants