devel-nytprof icon indicating copy to clipboard operation
devel-nytprof copied to clipboard

Enhancement request: make the table headers stay on the page

Open PenelopeFudd opened this issue 11 years ago • 4 comments

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!

PenelopeFudd avatar Oct 10 '13 21:10 PenelopeFudd

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?

ghost avatar Oct 06 '16 21:10 ghost

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 :)

timbunce avatar Oct 07 '16 10:10 timbunce

@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.

ghost avatar Oct 10 '16 16:10 ghost

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.

anall avatar Jan 18 '22 19:01 anall