8

I've looked around, and it looks like there is no way to lock the first row of a mediawiki table. By freezing, I mean, like how you lock the top row of a spreadsheet table. This seems like a very desirable feature when you're creating a table with a large number of rows, so the user doesn't have to scroll to the top to see the column name.

Does anyone know of a way to lock the header row of the table so it would just float there even when you scroll to the bottom of the long table?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
aalosious
  • 578
  • 6
  • 11
  • 2
    Possible duplicate of [HTML table with fixed headers?](http://stackoverflow.com/questions/673153/html-table-with-fixed-headers) – Tgr Nov 27 '15 at 00:52
  • 1
    No it's not. The question is specifically about Mediawiki. And my solution (see below) is different from the solution from that thread. – ThePhi May 03 '19 at 06:39

2 Answers2

5

This is possible on the English Wikipedia with a gadget.

First you need to register and login. Then, go to: https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-gadgets

Under Testing and development, check Make sure that headers of tables remain in view as long as the table is in view (requires Firefox v59 or Safari).

And voilà!

Nemo
  • 2,441
  • 2
  • 29
  • 63
ThePhi
  • 2,373
  • 3
  • 28
  • 38
2

As far as I know, there is no proper solution yet for this problem in MediaWiki (and CMS in general?). It's tracked at Bug T42763: Implement repeated/fixed/floating table headers.

Nemo
  • 2,441
  • 2
  • 29
  • 63
  • there is now! (see my solution) – ThePhi May 03 '19 at 06:40
  • @ThePhi Thanks for the update. That's only a gadget local to the English Wikipedia, which is why the MediaWiki feature request is still open. However it's a first step to see the feature request fixed in the future. – Nemo May 04 '19 at 21:46