Table adapted from: List of countries by firearm-related death rate‎.

Used some of the relevant wikitext from this Qwerty284651 table:

<templatestyles src="COVID-19 pandemic data/styles.css"/>
<div class="covid19-container" role="region" tabindex="0">
<div class="scroll-container">
{{mw-datatable}}{{sort under}}{{table alignment}}
{| class="wikitable sortable mw-datatable defaultcenter col1left sort-under-center sticky-col1" style="margin:0; font-size: 90%"
|- class="sticky-row"

Fully-sticky table in scroll window

edit

Relevant wikitext for table below:

<templatestyles src="COVID-19 pandemic data/styles.css"/>
<div class="covid19-container" role="region" tabindex="0">
<div class="scroll-container">
{{mw-datatable}}{{sort-under}}{{static row numbers}}
{| class="wikitable sortable mw-datatable sort-under sticky-col1 static-row-numbers" style="text-align:right; margin:0;"
|- class="sticky-row"

The location column with flags in the table below sorts correctly in mobile browsers. Unlike the same table using {{sticky header}} here.

Homicide rates by firearm per 100,000 inhabitants.
Location 2022 2021 2020 2019 2018 2017 2016 2015 2014
  Albania * 1.126 1.751 1.430 1.635 1.599 1.528 1.493 1.596 2.427
  Algeria 0.096 0.140 0.133 0.084 0.091 0.129 0.136 0.217 0.106
  Andorra 0 0
  Antigua and Barbuda 8.532 4.291 3.238 2.171 3.274 10.975 4.417 1.112
  Argentina * 2.305 2.418 2.685 2.521 2.733 2.826 3.655
  Armenia * 0.674 0.212 0.631 0.523 0.903 0.277
  Australia * 0.103 0.096 0.078 0.150 0.100 0.094 0.132 0.113 0.153
  Austria * 0.145 0.179 0.135 0.101 0.090 0.182 0.103 0.058 0.105
  Azerbaijan * 0.165 0.175 0.186 0.148 0.179 0.180
  Bahamas 28.538 25.496 14.269 19.528 20.154 26.816 23.739 28.521 26.983
  Barbados 11.717 6.046 9.263 11.064 6.436 8.238 5.742 6.832 6.126
  Belarus 0.206
  Belize * 22.454 22.748 20.004 23.388 25.127 21.885 22.324 19.729 20.151
  Bermuda 4.674 3.124 0 4.719 4.741 7.928 1.584 3.157
  Bhutan * 0 0 0 0 0 0
  Bolivia * 0.384 0.306 0.184 0.272 0.267 0.376 0.169 0.099
  Bosnia and Herzegovina 0.495 0.428 0.362 0.625 0.441 0.669 0.546 0.908 0.644
  Brazil * 15.945
  Bulgaria * 0.237 0.152 0.287 0.244
  Cape Verde * 1.926 2.124 5.552 2.717 4.761
  Canada * 0.889 0.781 0.736 0.704 0.678 0.730 0.617 0.501 0.438
  Chile * 3.637 2.221 2.617 1.854 2.016 1.818 1.532 1.466 1.442
  Colombia * 18.127 18.252 16.344 16.149 16.470 18.357 18.528 19.682 21.126
  Costa Rica * 8.304 7.905 7.474 7.955 8.711 7.765 7.865 6.750
  Croatia 0.223 0.172 0.268 0.363 0.120 0.572 0.331 0.165 0.373
  Cyprus * 0.160 0.402 0.242 0.163 0.164 0.165 0.501 0.505 0.255
  Czech Republic * 0.095 0.076 0.047 0.085 0.076 0.066 0.019 0.095
  Denmark * 0.052 0.139 0.175
  Dominica 1.381 9.723 9.800 9.884 8.522 2.854 0 0
  Dominican Republic * 6.724 6.116 4.409 4.264 4.914 5.767 5.918 11.116
  Ecuador * 22.565 10.248 4.588 3.759 2.727 3.025 2.731 3.365 4.355
  Egypt *
  El Salvador * 4.782 11.181 14.715 27.929 41.441 47.984 68.106 88.845 48.393
  Eswatini 1.426
  Finland * 0.091 0.218 0.109 0.164 0.219 0.201
  France * 0.100 0.142
  Georgia 0.848 0.768
  Germany * 0.065 0.048 0.045 0.052 0.069
  Greece * 0.318 0.268 0.257 0.236 0.329 0.206 0.242
  Grenada 0 1.617 0 2.462 0 0.834 0
  Guatemala * 3.436 3.554 6.197 6.712 8.457 33.380 26.270
  Guyana * 2.983 3.387 4.131 2.546 2.882 4.216 5.695
  Holy See 0 0 0 0
  Honduras * 28.721 26.962 30.194 27.112 29.158 41.868 42.294 53.364
  Hong Kong * 0 0 0 0 0.027 0 0 0 0.014
  Hungary * 0.040 0.021 0.072 0.031 0.123 0 0.041 0.030
  Iceland 0.270 0 0 0 0 0.298 0 0
  India *
  Iran * 0.369 0.543
  Italy * 0.202 0.154 0.171
  Jamaica * 44.706 44.206 39.639 39.769 36.097 47.857 39.248 34.855 25.677
  Japan * 0.003 0.003 0.002
  Jordan * 0.425 0.242 0.311 0.449 0.335 0.460
  Kazakhstan * 0.105 0.349 0.261
  Liechtenstein 0
  Lithuania 0.106 0.070 0.139 0.241 0.102
  Luxembourg 0.180
  Macau * 0 0
  Malta 0 0.776 0.596 0.203 0.417 0 0.438 0.672
  Mauritius * 0 0.154
  Mexico * 17.497 19.333 20.346 20.679 20.723 17.842 13.106 10.654 10.058
  Monaco 0
  Mongolia 0.090 0.061 0 0.190 0.065 0.099 0.101 0.276
  Montenegro * 1.914 1.115 1.908 2.062 1.109 1.739 2.527 1.577 1.892
  Morocco 0.024 0.005 0.094 0.025 0.014 0.009 0.043 0.006
  Netherlands 0.216 0.194 0.184 0.190 0.185 0.209 0.152 0.182 0.236
  New Zealand * 1.230 0.248 0.232 0.171 0.152 0.133
  Nicaragua 2.000 3.286 6.117 2.886 3.302
  North Macedonia 0.238 0.189 0.568 0.758 0.237 0.854 1.092
  Northern Ireland * 0.157 0.210 0.158 0.264 0.106 0.107 0.322 0.270 0.109
  Oman * 0.066 0.065 0.022 0 0.045 0
  Palestine * 0.370
  Panama * 10.227 9.361 8.624 7.058 6.494 7.078 8.087 11.289
  Paraguay * 4.803 4.351 5.360 4.609 5.491 6.670 6.442 5.746
  Peru * 2.937 2.288 3.357 3.113 3.312 3.416 4.194
  Philippines * 1.103 1.567 3.050 4.286
  Puerto Rico * 18.382 15.898 17.697
  Moldova * 0.227 0.289 0.255 0.283 0.120
  Saint Kitts and Nevis * 25.207 12.594 18.863 33.500 39.761 60.685
  Saint Lucia * 30.580 26.162 22.317 17.359 12.367 18.062
  Saint Vincent and the Grenadines 20.128 17.203 9.531 20.897 22.738 27.368
  Serbia * 0.235 0.151 0.272 0.351 0.552 0.415 0.173 0.186
  Slovakia * 0.071 0.055 0.055 0.275 0.110 0.184 0.276 0.055 0.240
  Slovenia * 0.142 0 0 0.284 0.095 0.143 0.048 0.048 0.193
  South Korea * 0
  Scotland * 0.018 0.055 0.018 0.055 0.037 0.019 0.019 0
  Spain * 0.105 0.082 0.078 0.112 0.105 0.135 0.084 0.097 0.121
  Sri Lanka * 0.074 0.343 0.237 0.224 0.211 0.240
  Suriname * 3.398 2.610 2.141 1.666 3.369 1.362 2.580
  Sweden * 0.597 0.430 0.463 0.438 0.423 0.398 0.301 0.335 0.287
  Switzerland * 0.137 0.092 0.104 0.128 0.153 0.166 0.191 0.205 0.085
  Tajikistan 0.063
  Tanzania 0.103 0.152
  Thailand * 1.464 1.805
  Trinidad and Tobago * 20.551 28.488 27.647 25.497 23.285 20.956
  Uganda 0.661 0.561 0.426 0.431
  United Arab Emirates * 0.043 0
  United Kingdom * 0.047 0.054 0.048 0.055 0.041 0.037
  United States * 4.054 3.152 3.156 3.342 3.178 2.804 2.581
  Uruguay 6.807 5.370 6.387 7.175 8.696 4.968 4.745 5.877 4.806
  Uzbekistan 0.012 0.009 0.022 0.035

Partially-sticky table. Not in scroll window

edit

It seems that removing this line of wikitext also removes the top sticky headers from desktop PC browsers:

<div class="scroll-container">

The sticky row headers still work in both desktop and mobile. But the top sticky headers only work in mobile browsers.

Relevant wikitext for table below:

<templatestyles src="COVID-19 pandemic data/styles.css"/>
<div class="covid19-container" role="region" tabindex="0">
{{mw-datatable}}{{sort-under}}{{static row numbers}}
{| class="wikitable sortable mw-datatable sort-under sticky-col1 static-row-numbers" style="text-align:right; margin:0;"
|- class="sticky-row"

The location column with flags in the table below sorts correctly in mobile browsers. Unlike the same table using {{sticky header}} here.

Homicide rates by firearm per 100,000 inhabitants.
Location 2022 2021 2020 2019 2018 2017 2016 2015 2014
  Albania * 1.126 1.751 1.430 1.635 1.599 1.528 1.493 1.596 2.427
  Algeria 0.096 0.140 0.133 0.084 0.091 0.129 0.136 0.217 0.106
  Andorra 0 0
  Antigua and Barbuda 8.532 4.291 3.238 2.171 3.274 10.975 4.417 1.112
  Argentina * 2.305 2.418 2.685 2.521 2.733 2.826 3.655
  Armenia * 0.674 0.212 0.631 0.523 0.903 0.277
  Australia * 0.103 0.096 0.078 0.150 0.100 0.094 0.132 0.113 0.153
  Austria * 0.145 0.179 0.135 0.101 0.090 0.182 0.103 0.058 0.105
  Azerbaijan * 0.165 0.175 0.186 0.148 0.179 0.180
  Bahamas 28.538 25.496 14.269 19.528 20.154 26.816 23.739 28.521 26.983
  Barbados 11.717 6.046 9.263 11.064 6.436 8.238 5.742 6.832 6.126
  Belarus 0.206
  Belize * 22.454 22.748 20.004 23.388 25.127 21.885 22.324 19.729 20.151
  Bermuda 4.674 3.124 0 4.719 4.741 7.928 1.584 3.157
  Bhutan * 0 0 0 0 0 0
  Bolivia * 0.384 0.306 0.184 0.272 0.267 0.376 0.169 0.099
  Bosnia and Herzegovina 0.495 0.428 0.362 0.625 0.441 0.669 0.546 0.908 0.644
  Brazil * 15.945
  Bulgaria * 0.237 0.152 0.287 0.244
  Cape Verde * 1.926 2.124 5.552 2.717 4.761
  Canada * 0.889 0.781 0.736 0.704 0.678 0.730 0.617 0.501 0.438
  Chile * 3.637 2.221 2.617 1.854 2.016 1.818 1.532 1.466 1.442
  Colombia * 18.127 18.252 16.344 16.149 16.470 18.357 18.528 19.682 21.126
  Costa Rica * 8.304 7.905 7.474 7.955 8.711 7.765 7.865 6.750
  Croatia 0.223 0.172 0.268 0.363 0.120 0.572 0.331 0.165 0.373
  Cyprus * 0.160 0.402 0.242 0.163 0.164 0.165 0.501 0.505 0.255
  Czech Republic * 0.095 0.076 0.047 0.085 0.076 0.066 0.019 0.095
  Denmark * 0.052 0.139 0.175
  Dominica 1.381 9.723 9.800 9.884 8.522 2.854 0 0
  Dominican Republic * 6.724 6.116 4.409 4.264 4.914 5.767 5.918 11.116
  Ecuador * 22.565 10.248 4.588 3.759 2.727 3.025 2.731 3.365 4.355
  Egypt *
  El Salvador * 4.782 11.181 14.715 27.929 41.441 47.984 68.106 88.845 48.393
  Eswatini 1.426
  Finland * 0.091 0.218 0.109 0.164 0.219 0.201
  France * 0.100 0.142
  Georgia 0.848 0.768
  Germany * 0.065 0.048 0.045 0.052 0.069
  Greece * 0.318 0.268 0.257 0.236 0.329 0.206 0.242
  Grenada 0 1.617 0 2.462 0 0.834 0
  Guatemala * 3.436 3.554 6.197 6.712 8.457 33.380 26.270
  Guyana * 2.983 3.387 4.131 2.546 2.882 4.216 5.695
  Holy See 0 0 0 0
  Honduras * 28.721 26.962 30.194 27.112 29.158 41.868 42.294 53.364
  Hong Kong * 0 0 0 0 0.027 0 0 0 0.014
  Hungary * 0.040 0.021 0.072 0.031 0.123 0 0.041 0.030
  Iceland 0.270 0 0 0 0 0.298 0 0
  India *
  Iran * 0.369 0.543
  Italy * 0.202 0.154 0.171
  Jamaica * 44.706 44.206 39.639 39.769 36.097 47.857 39.248 34.855 25.677
  Japan * 0.003 0.003 0.002
  Jordan * 0.425 0.242 0.311 0.449 0.335 0.460
  Kazakhstan * 0.105 0.349 0.261
  Liechtenstein 0
  Lithuania 0.106 0.070 0.139 0.241 0.102
  Luxembourg 0.180
  Macau * 0 0
  Malta 0 0.776 0.596 0.203 0.417 0 0.438 0.672
  Mauritius * 0 0.154
  Mexico * 17.497 19.333 20.346 20.679 20.723 17.842 13.106 10.654 10.058
  Monaco 0
  Mongolia 0.090 0.061 0 0.190 0.065 0.099 0.101 0.276
  Montenegro * 1.914 1.115 1.908 2.062 1.109 1.739 2.527 1.577 1.892
  Morocco 0.024 0.005 0.094 0.025 0.014 0.009 0.043 0.006
  Netherlands 0.216 0.194 0.184 0.190 0.185 0.209 0.152 0.182 0.236
  New Zealand * 1.230 0.248 0.232 0.171 0.152 0.133
  Nicaragua 2.000 3.286 6.117 2.886 3.302
  North Macedonia 0.238 0.189 0.568 0.758 0.237 0.854 1.092
  Northern Ireland * 0.157 0.210 0.158 0.264 0.106 0.107 0.322 0.270 0.109
  Oman * 0.066 0.065 0.022 0 0.045 0
  Palestine * 0.370
  Panama * 10.227 9.361 8.624 7.058 6.494 7.078 8.087 11.289
  Paraguay * 4.803 4.351 5.360 4.609 5.491 6.670 6.442 5.746
  Peru * 2.937 2.288 3.357 3.113 3.312 3.416 4.194
  Philippines * 1.103 1.567 3.050 4.286
  Puerto Rico * 18.382 15.898 17.697
  Moldova * 0.227 0.289 0.255 0.283 0.120
  Saint Kitts and Nevis * 25.207 12.594 18.863 33.500 39.761 60.685
  Saint Lucia * 30.580 26.162 22.317 17.359 12.367 18.062
  Saint Vincent and the Grenadines 20.128 17.203 9.531 20.897 22.738 27.368
  Serbia * 0.235 0.151 0.272 0.351 0.552 0.415 0.173 0.186
  Slovakia * 0.071 0.055 0.055 0.275 0.110 0.184 0.276 0.055 0.240
  Slovenia * 0.142 0 0 0.284 0.095 0.143 0.048 0.048 0.193
  South Korea * 0
  Scotland * 0.018 0.055 0.018 0.055 0.037 0.019 0.019 0
  Spain * 0.105 0.082 0.078 0.112 0.105 0.135 0.084 0.097 0.121
  Sri Lanka * 0.074 0.343 0.237 0.224 0.211 0.240
  Suriname * 3.398 2.610 2.141 1.666 3.369 1.362 2.580
  Sweden * 0.597 0.430 0.463 0.438 0.423 0.398 0.301 0.335 0.287
  Switzerland * 0.137 0.092 0.104 0.128 0.153 0.166 0.191 0.205 0.085
  Tajikistan 0.063
  Tanzania 0.103 0.152
  Thailand * 1.464 1.805
  Trinidad and Tobago * 20.551 28.488 27.647 25.497 23.285 20.956
  Uganda 0.661 0.561 0.426 0.431
  United Arab Emirates * 0.043 0
  United Kingdom * 0.047 0.054 0.048 0.055 0.041 0.037
  United States * 4.054 3.152 3.156 3.342 3.178 2.804 2.581
  Uruguay 6.807 5.370 6.387 7.175 8.696 4.968 4.745 5.877 4.806
  Uzbekistan 0.012 0.009 0.022 0.035