Special:Preferences#mw-prefsection-gadgets. Search for "sticky" to find: "Make headers of tables display as long as the table is in view, i.e. 'sticky' (requires Chrome v91+, Firefox v59+, or Safari)." It works in Edge too. It only works in desktop view. Unfortunately, it doesn't do sticky row headers. That would be helpful in tablets, and smaller notebooks. There are even a few tables on Wikipedia that are too wide for desktop view in regular monitors. So sticky row headers would help in that case too. Here is a page to test it on: