Jump to content

Help talk:Table/Archive 8

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 02:29, 7 June 2021 (Archiving 1 discussion(s) from Help talk:Table) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Archive 5Archive 6Archive 7Archive 8Archive 9Archive 10

Partially collapsed table with vertical scrolling and show/hide links?

{{COVID-19 pandemic death rates by country}}

Is there a simple way to convert this below to a partially collapsed table with vertical scrolling? Along with show/hide links?

COVID-19 pandemic death rates by country.
Updated April 1, 2025.
COVID-19 pandemic cases and mortality by country[1]
Country Deaths / million Deaths Cases
World[a] 883 7,057,132 775,866,783
Peru 6,601 220,975 4,526,977
Bulgaria 5,669 38,700 1,329,988
North Macedonia 5,422 9,978 350,924
Bosnia and Herzegovina 5,114 16,392 403,666
Hungary 5,065 49,053 2,230,800
Croatia 4,799 18,752 1,317,144
Slovenia 4,766 10,083 1,356,582
Georgia 4,519 17,150 1,863,615
Montenegro 4,317 2,654 251,280
Czech Republic 4,076 43,509 4,761,919
Moldova 4,027 12,245 637,520
Latvia 3,973 7,475 977,765
Slovakia 3,878 21,227 1,878,002
Greece 3,770 39,258 5,673,681
San Marino 3,693 126 25,292
Romania 3,590 68,825 3,541,619
United States 3,493 1,193,165 103,436,829
Lithuania 3,482 9,810 1,369,355
United Kingdom 3,404 232,112 24,974,629
Brazil 3,338 702,116 37,511,921
Italy 3,309 197,307 26,781,078
Chile 3,208 62,730 5,401,126
Martinique 3,159 1,104 230,354
Poland 3,145 120,726 6,670,799
Armenia 3,046 8,777 452,273
Gibraltar 3,002 113 20,550
Belgium 2,949 34,339 4,872,829
Paraguay 2,940 19,880 735,759
Trinidad and Tobago 2,934 4,390 191,496
Argentina 2,877 130,663 10,101,218
European Union[b] 2,812 1,262,988 185,822,587
Russia 2,769 403,188 24,268,728
Portugal 2,765 28,809 5,664,109
Colombia 2,758 142,727 6,391,876
Aruba 2,708 292 44,224
Ukraine 2,677 109,920 5,532,777
Serbia 2,658 18,057 2,583,470
Guadeloupe 2,653 1,021 203,235
France 2,615 168,091 38,997,490
Sweden 2,612 27,399 2,755,181
Mexico 2,601 334,551 7,619,458
Spain 2,547 121,852 13,980,340
Bermuda 2,547 165 18,860
Guam 2,536 419 52,287
Austria 2,485 22,534 6,082,444
Tunisia 2,427 29,423 1,153,361
French Polynesia 2,318 650 79,387
Saint Lucia 2,293 410 30,282
Uruguay 2,265 7,682 1,041,346
Liechtenstein 2,262 89 21,588
Suriname 2,256 1,406 82,501
Estonia 2,220 2,998 610,471
Sint Maarten 2,182 92 11,051
Bahamas 2,135 849 39,127
Barbados 2,100 593 108,582
Germany 2,080 174,979 38,437,756
Finland 2,058 11,466 1,499,712
Grenada 2,035 238 19,693
Ecuador 2,022 36,050 1,077,445
Andorra 1,994 159 48,015
Panama 1,987 8,748 1,044,821
Republic of Ireland 1,906 9,744 1,745,088
Lebanon 1,905 10,947 1,239,904
Kosovo 1,869 3,212 274,279
Bolivia 1,853 22,387 1,212,147
Costa Rica 1,844 9,372 1,234,701
Puerto Rico 1,832 5,938 1,252,713
Hong Kong 1,798 13,466 2,876,106
Montserrat 1,787 8 1,403
Malta 1,745 922 122,796
Monaco 1,720 67 17,181
Belize 1,708 688 71,414
British Virgin Islands 1,669 64 7,557
Curaçao 1,645 305 45,883
South Africa 1,644 102,595 4,072,765
Denmark 1,642 9,693 3,435,679
Iran 1,640 146,837 7,627,863
Switzerland 1,611 14,170 4,457,868
Collectivity of Saint Martin 1,591 46 12,324
Guyana 1,584 1,302 74,443
Antigua and Barbuda 1,572 146 9,106
Jersey 1,555 161 66,391
Luxembourg 1,530 1,000 393,542
United States Virgin Islands 1,525 132 25,389
Caribbean Netherlands 1,430 41 11,922
Canada 1,424 55,282 4,819,055
Namibia 1,421 4,108 172,533
Israel 1,395 12,707 4,841,558
French Guiana 1,384 413 98,041
Isle of Man 1,378 116 38,008
Seychelles 1,370 172 51,886
Netherlands 1,283 22,986 8,640,008
Albania 1,274 3,605 335,047
Jamaica 1,271 3,611 157,181
Jordan 1,254 14,122 1,746,997
Saint Vincent and the Grenadines 1,214 124 9,674
Eswatini 1,170 1,427 75,356
Turkey 1,164 101,419 17,004,718
Botswana 1,148 2,801 330,696
Guatemala 1,131 20,203 1,250,371
Dominica 1,106 74 16,047
New Caledonia 1,093 314 80,163
Cyprus 1,089 1,451 696,410
Malaysia 1,076 37,351 5,309,410
Palestine 1,075 5,708 703,228
Honduras 1,062 11,114 472,896
Réunion 1,056 921 494,595
Guernsey 1,051 67 35,326
Norway 1,050 5,732 1,512,647
Azerbaijan 1,005 10,353 835,757
Bahrain 1,001 1,536 696,614
Saint Kitts and Nevis 984 46 6,607
Oman 978 4,628 399,449
Australia 963 25,236 11,861,161
Fiji 962 885 69,047
Kazakhstan 951 19,072 1,504,370
Libya 891 6,437 507,269
Northern Mariana Islands 889 41 14,912
Turks and Caicos Islands 872 40 6,805
Anguilla 844 12 3,904
Mauritius 840 1,073 328,167
New Zealand 834 4,284 2,639,048
Cabo Verde 802 417 64,474
Wallis and Futuna 782 9 3,760
Belarus 775 7,118 994,037
Cuba 771 8,530 1,113,662
Sri Lanka 740 16,907 672,798
Taiwan 739 17,672 9,970,937
American Samoa 702 34 8,359
South Korea 693 35,934 34,571,873
El Salvador 673 4,230 201,920
Mongolia 630 2,136 1,011,489
Mayotte 612 187 42,027
Maldives 602 316 186,694
Japan 597 74,694 33,803,572
Philippines 586 66,864 4,140,383
Indonesia 581 162,059 6,829,399
Federated States of Micronesia 579 65 31,765
Iraq 575 25,375 2,465,545
Palau 562 10 6,372
Kuwait 559 2,570 667,290
Faroe Islands 518 28 34,658
Cayman Islands 516 37 31,472
Iceland 489 186 210,374
Thailand 483 34,715 4,799,180
Saint Barthélemy 456 5 5,507
Morocco 436 16,305 1,279,115
Vietnam 433 43,206 11,624,000
Marshall Islands 424 17 16,297
Nepal 404 12,031 1,003,450
Brunei 393 179 347,723
Dominican Republic 390 4,384 661,103
Greenland 374 21 11,971
India 374 533,623 45,041,748
Myanmar 362 19,494 642,885
Singapore 358 2,024 3,006,155
Zimbabwe 357 5,740 266,386
Sao Tome and Principe 353 80 6,771
Saint Pierre and Miquelon 347 2 3,426
Lesotho 310 709 36,138
Saudi Arabia 299 9,646 841,469
Solomon Islands 254 199 25,954
Qatar 238 690 514,524
United Arab Emirates 229 2,349 1,067,030
Egypt 220 24,830 516,023
Venezuela 207 5,856 552,695
Mauritania 204 997 63,872
Zambia 202 4,077 349,842
Afghanistan 197 7,998 235,214
Comoros 191 160 9,109
Kiribati 183 24 5,085
Cambodia 177 3,056 139,319
Bangladesh 174 29,499 2,051,348
Macau 174 121 3,514
Djibouti 166 189 15,690
Algeria 151 6,881 272,139
Kyrgyzstan 147 1,024 88,953
Samoa 144 31 17,057
Gambia 141 372 12,627
Syria 140 3,163 57,423
Cook Islands 135 2 7,345
Malawi 130 2,686 89,168
Gabon 126 307 49,051
Pakistan 125 30,656 1,580,631
Tonga 114 12 16,976
Senegal 111 1,971 89,485
Rwanda 107 1,468 133,264
Kenya 104 5,689 344,106
Sudan 102 5,046 63,993
Equatorial Guinea 101 183 17,130
Timor-Leste 100 138 23,460
Tuvalu 99 1 2,943
Laos 88 671 219,060
China[c] 85 122,304 99,373,219
Nauru 84 1 5,393
Guinea-Bissau 84 177 9,614
Uganda 76 3,632 172,154
Somalia 76 1,361 27,334
Haiti 74 860 34,456
Cameroon 71 1,974 125,246
Mozambique 68 2,252 233,843
Papua New Guinea 65 670 46,864
Republic of the Congo 64 389 25,227
Ethiopia 60 7,574 501,193
Yemen 56 2,159 11,945
Liberia 54 294 7,930
Angola 54 1,937 107,481
Madagascar 46 1,428 68,567
Vanuatu 44 14 12,019
Ghana 44 1,462 172,062
Nicaragua 36 245 16,185
Guinea 33 468 38,572
Mali 32 743 33,166
Togo 31 290 39,530
Eritrea 30 103 10,189
Uzbekistan 29 1,016 175,081
Ivory Coast 27 835 88,434
Bhutan 26 21 62,697
Central African Republic 22 113 15,441
Burkina Faso 17 400 22,139
Sierra Leone 15 125 7,979
Democratic Republic of the Congo 14 1,474 101,009
Nigeria 14 3,155 267,188
South Sudan 13 147 18,823
Tanzania 13 846 43,230
Niger 12 315 9,518
Tajikistan 12 125 17,786
Benin 11 163 28,036
Chad 10 194 7,702
Burundi 1 15 54,569
Vatican City 0 0 26
Niue 0 0 1,074
Falkland Islands 0 0 1,923
Saint Helena, Ascension and Tristan da Cunha 0 0 2,166
Pitcairn Islands 0 0 4
Tokelau 0 0 80
North Korea 0 0 0
Turkmenistan 0 0 0
  1. ^ Countries which do not report data for a column are not included in that column's world total.
  2. ^ Data on member states of the European Union are individually listed, but are also summed here for convenience. They are not double-counted in world totals.
  3. ^ Does not include special administrative regions (Hong Kong and Macau) or Taiwan.
{| class="wikitable mw-collapsible mw-collapsed"
![[COVID-19 pandemic death rates by country]]. 
|-
|{{Template:COVID-19 pandemic death rates by country}}
|}

References

  1. ^ Mathieu, Edouard; Ritchie, Hannah; Rodés-Guirao, Lucas; Appel, Cameron; Giattino, Charlie; Hasell, Joe; Macdonald, Bobbie; Dattani, Saloni; Beltekian, Diana; Ortiz-Ospina, Esteban; Roser, Max (2020–2024). "Coronavirus Pandemic (COVID-19)". Our World in Data. Retrieved 2025-04-01.

The table reference will show up in the references section of the article it is in. I used {{talk refs}} here to place the references in this talk section.

There is discussion here:

--Timeshifter (talk) 19:41, 27 August 2020 (UTC)

@Timeshifter: This will do it
COVID-19 pandemic death rates by country.
Updated April 1, 2025.
COVID-19 pandemic cases and mortality by country[1]
Country Deaths / million Deaths Cases
World[a] 883 7,057,132 775,866,783
Peru 6,601 220,975 4,526,977
Bulgaria 5,669 38,700 1,329,988
North Macedonia 5,422 9,978 350,924
Bosnia and Herzegovina 5,114 16,392 403,666
Hungary 5,065 49,053 2,230,800
Croatia 4,799 18,752 1,317,144
Slovenia 4,766 10,083 1,356,582
Georgia 4,519 17,150 1,863,615
Montenegro 4,317 2,654 251,280
Czech Republic 4,076 43,509 4,761,919
Moldova 4,027 12,245 637,520
Latvia 3,973 7,475 977,765
Slovakia 3,878 21,227 1,878,002
Greece 3,770 39,258 5,673,681
San Marino 3,693 126 25,292
Romania 3,590 68,825 3,541,619
United States 3,493 1,193,165 103,436,829
Lithuania 3,482 9,810 1,369,355
United Kingdom 3,404 232,112 24,974,629
Brazil 3,338 702,116 37,511,921
Italy 3,309 197,307 26,781,078
Chile 3,208 62,730 5,401,126
Martinique 3,159 1,104 230,354
Poland 3,145 120,726 6,670,799
Armenia 3,046 8,777 452,273
Gibraltar 3,002 113 20,550
Belgium 2,949 34,339 4,872,829
Paraguay 2,940 19,880 735,759
Trinidad and Tobago 2,934 4,390 191,496
Argentina 2,877 130,663 10,101,218
European Union[b] 2,812 1,262,988 185,822,587
Russia 2,769 403,188 24,268,728
Portugal 2,765 28,809 5,664,109
Colombia 2,758 142,727 6,391,876
Aruba 2,708 292 44,224
Ukraine 2,677 109,920 5,532,777
Serbia 2,658 18,057 2,583,470
Guadeloupe 2,653 1,021 203,235
France 2,615 168,091 38,997,490
Sweden 2,612 27,399 2,755,181
Mexico 2,601 334,551 7,619,458
Spain 2,547 121,852 13,980,340
Bermuda 2,547 165 18,860
Guam 2,536 419 52,287
Austria 2,485 22,534 6,082,444
Tunisia 2,427 29,423 1,153,361
French Polynesia 2,318 650 79,387
Saint Lucia 2,293 410 30,282
Uruguay 2,265 7,682 1,041,346
Liechtenstein 2,262 89 21,588
Suriname 2,256 1,406 82,501
Estonia 2,220 2,998 610,471
Sint Maarten 2,182 92 11,051
Bahamas 2,135 849 39,127
Barbados 2,100 593 108,582
Germany 2,080 174,979 38,437,756
Finland 2,058 11,466 1,499,712
Grenada 2,035 238 19,693
Ecuador 2,022 36,050 1,077,445
Andorra 1,994 159 48,015
Panama 1,987 8,748 1,044,821
Republic of Ireland 1,906 9,744 1,745,088
Lebanon 1,905 10,947 1,239,904
Kosovo 1,869 3,212 274,279
Bolivia 1,853 22,387 1,212,147
Costa Rica 1,844 9,372 1,234,701
Puerto Rico 1,832 5,938 1,252,713
Hong Kong 1,798 13,466 2,876,106
Montserrat 1,787 8 1,403
Malta 1,745 922 122,796
Monaco 1,720 67 17,181
Belize 1,708 688 71,414
British Virgin Islands 1,669 64 7,557
Curaçao 1,645 305 45,883
South Africa 1,644 102,595 4,072,765
Denmark 1,642 9,693 3,435,679
Iran 1,640 146,837 7,627,863
Switzerland 1,611 14,170 4,457,868
Collectivity of Saint Martin 1,591 46 12,324
Guyana 1,584 1,302 74,443
Antigua and Barbuda 1,572 146 9,106
Jersey 1,555 161 66,391
Luxembourg 1,530 1,000 393,542
United States Virgin Islands 1,525 132 25,389
Caribbean Netherlands 1,430 41 11,922
Canada 1,424 55,282 4,819,055
Namibia 1,421 4,108 172,533
Israel 1,395 12,707 4,841,558
French Guiana 1,384 413 98,041
Isle of Man 1,378 116 38,008
Seychelles 1,370 172 51,886
Netherlands 1,283 22,986 8,640,008
Albania 1,274 3,605 335,047
Jamaica 1,271 3,611 157,181
Jordan 1,254 14,122 1,746,997
Saint Vincent and the Grenadines 1,214 124 9,674
Eswatini 1,170 1,427 75,356
Turkey 1,164 101,419 17,004,718
Botswana 1,148 2,801 330,696
Guatemala 1,131 20,203 1,250,371
Dominica 1,106 74 16,047
New Caledonia 1,093 314 80,163
Cyprus 1,089 1,451 696,410
Malaysia 1,076 37,351 5,309,410
Palestine 1,075 5,708 703,228
Honduras 1,062 11,114 472,896
Réunion 1,056 921 494,595
Guernsey 1,051 67 35,326
Norway 1,050 5,732 1,512,647
Azerbaijan 1,005 10,353 835,757
Bahrain 1,001 1,536 696,614
Saint Kitts and Nevis 984 46 6,607
Oman 978 4,628 399,449
Australia 963 25,236 11,861,161
Fiji 962 885 69,047
Kazakhstan 951 19,072 1,504,370
Libya 891 6,437 507,269
Northern Mariana Islands 889 41 14,912
Turks and Caicos Islands 872 40 6,805
Anguilla 844 12 3,904
Mauritius 840 1,073 328,167
New Zealand 834 4,284 2,639,048
Cabo Verde 802 417 64,474
Wallis and Futuna 782 9 3,760
Belarus 775 7,118 994,037
Cuba 771 8,530 1,113,662
Sri Lanka 740 16,907 672,798
Taiwan 739 17,672 9,970,937
American Samoa 702 34 8,359
South Korea 693 35,934 34,571,873
El Salvador 673 4,230 201,920
Mongolia 630 2,136 1,011,489
Mayotte 612 187 42,027
Maldives 602 316 186,694
Japan 597 74,694 33,803,572
Philippines 586 66,864 4,140,383
Indonesia 581 162,059 6,829,399
Federated States of Micronesia 579 65 31,765
Iraq 575 25,375 2,465,545
Palau 562 10 6,372
Kuwait 559 2,570 667,290
Faroe Islands 518 28 34,658
Cayman Islands 516 37 31,472
Iceland 489 186 210,374
Thailand 483 34,715 4,799,180
Saint Barthélemy 456 5 5,507
Morocco 436 16,305 1,279,115
Vietnam 433 43,206 11,624,000
Marshall Islands 424 17 16,297
Nepal 404 12,031 1,003,450
Brunei 393 179 347,723
Dominican Republic 390 4,384 661,103
Greenland 374 21 11,971
India 374 533,623 45,041,748
Myanmar 362 19,494 642,885
Singapore 358 2,024 3,006,155
Zimbabwe 357 5,740 266,386
Sao Tome and Principe 353 80 6,771
Saint Pierre and Miquelon 347 2 3,426
Lesotho 310 709 36,138
Saudi Arabia 299 9,646 841,469
Solomon Islands 254 199 25,954
Qatar 238 690 514,524
United Arab Emirates 229 2,349 1,067,030
Egypt 220 24,830 516,023
Venezuela 207 5,856 552,695
Mauritania 204 997 63,872
Zambia 202 4,077 349,842
Afghanistan 197 7,998 235,214
Comoros 191 160 9,109
Kiribati 183 24 5,085
Cambodia 177 3,056 139,319
Bangladesh 174 29,499 2,051,348
Macau 174 121 3,514
Djibouti 166 189 15,690
Algeria 151 6,881 272,139
Kyrgyzstan 147 1,024 88,953
Samoa 144 31 17,057
Gambia 141 372 12,627
Syria 140 3,163 57,423
Cook Islands 135 2 7,345
Malawi 130 2,686 89,168
Gabon 126 307 49,051
Pakistan 125 30,656 1,580,631
Tonga 114 12 16,976
Senegal 111 1,971 89,485
Rwanda 107 1,468 133,264
Kenya 104 5,689 344,106
Sudan 102 5,046 63,993
Equatorial Guinea 101 183 17,130
Timor-Leste 100 138 23,460
Tuvalu 99 1 2,943
Laos 88 671 219,060
China[c] 85 122,304 99,373,219
Nauru 84 1 5,393
Guinea-Bissau 84 177 9,614
Uganda 76 3,632 172,154
Somalia 76 1,361 27,334
Haiti 74 860 34,456
Cameroon 71 1,974 125,246
Mozambique 68 2,252 233,843
Papua New Guinea 65 670 46,864
Republic of the Congo 64 389 25,227
Ethiopia 60 7,574 501,193
Yemen 56 2,159 11,945
Liberia 54 294 7,930
Angola 54 1,937 107,481
Madagascar 46 1,428 68,567
Vanuatu 44 14 12,019
Ghana 44 1,462 172,062
Nicaragua 36 245 16,185
Guinea 33 468 38,572
Mali 32 743 33,166
Togo 31 290 39,530
Eritrea 30 103 10,189
Uzbekistan 29 1,016 175,081
Ivory Coast 27 835 88,434
Bhutan 26 21 62,697
Central African Republic 22 113 15,441
Burkina Faso 17 400 22,139
Sierra Leone 15 125 7,979
Democratic Republic of the Congo 14 1,474 101,009
Nigeria 14 3,155 267,188
South Sudan 13 147 18,823
Tanzania 13 846 43,230
Niger 12 315 9,518
Tajikistan 12 125 17,786
Benin 11 163 28,036
Chad 10 194 7,702
Burundi 1 15 54,569
Vatican City 0 0 26
Niue 0 0 1,074
Falkland Islands 0 0 1,923
Saint Helena, Ascension and Tristan da Cunha 0 0 2,166
Pitcairn Islands 0 0 4
Tokelau 0 0 80
North Korea 0 0 0
Turkmenistan 0 0 0
  1. ^ Countries which do not report data for a column are not included in that column's world total.
  2. ^ Data on member states of the European Union are individually listed, but are also summed here for convenience. They are not double-counted in world totals.
  3. ^ Does not include special administrative regions (Hong Kong and Macau) or Taiwan.
Wikitext
{| class="wikitable mw-collapsible"
![[COVID-19 pandemic death rates by country]]. 
|-
|{{scrolling window|link=Template:COVID-19 pandemic death rates by country|height=150px|title=New articles}}
|}

References

  1. ^ Mathieu, Edouard; Ritchie, Hannah; Rodés-Guirao, Lucas; Appel, Cameron; Giattino, Charlie; Hasell, Joe; Macdonald, Bobbie; Dattani, Saloni; Beltekian, Diana; Ortiz-Ospina, Esteban; Roser, Max (2020–2024). "Coronavirus Pandemic (COVID-19)". Our World in Data. Retrieved 2025-04-01.
Unfortunately I may not have time to read through the discussion at present, gotta finish checking my watch list here and on meta, also multitasking with real world stuff. However, I'm fairly certain that the manual of style discourages this usage in articlespace. (please ping on reply)
𝒬𝔔 16:58, 28 August 2020 (UTC)
Thanks Quantocius_Quantotius. I added a link to Template:Scrolling window to Help:Table#Scrolling. I also added a link to Template:COVID-19 pandemic data which is one of the few scrolling tables I have seen in article space.
Is it possible with Template:Scrolling window to set it up with a link to fully expand a table? As with Template:COVID-19 pandemic data? And is it possible with Template:Scrolling window to fix the header row such that it stays visible while scrolling? As at Template:COVID-19 pandemic data.
I wish to know the minimal wikitext involved with Template:COVID-19 pandemic data to do those 2 things: Full expansion and fixed header. Template:COVID-19 pandemic data has so much wikitext. Can you pull out the basics and use it here with Template:COVID-19 pandemic death rates by country?
--Timeshifter (talk) 23:52, 28 August 2020 (UTC)
 Done, however review by a second set of eyes wouldn't hurt; I haven't really done serious css stuff for a few years now and I've managed to make a few (thankfully minor) errors in template coding in recent weeks. I took it a bit more slowly here to double check and I had a bit more time today but it's still possible I missed something.
Other than that let me know if there's any other features you want and I'll try to get to them before the end of the month. Courtesy ping to Dudley Miles since you're working on this as well.
I'm going to try to be around Sunday at least for 30 minutes if you have any immediate questions, if not you may need to wait until around the 21st to catch me again as the next two weeks should be bit busy for me, thanks. (please ping on reply)
𝒬𝔔 22:43, 4 September 2020 (UTC)
Thanks Quantocius Quantotius, but it is no longer necessary. See: User:Timeshifter/Sandbox119. --Timeshifter (talk) 01:18, 5 September 2020 (UTC)
An improved version is at Template:COVID-19 pandemic death rates. Does this look OK? Dudley Miles (talk) 08:36, 30 August 2020 (UTC)
It needs a collapse button that brings it back to the scrollable box. I asked for help here:
Template talk:COVID-19 pandemic data#Need a link to collapse it back to its original scroll box size.
Template talk:COVID-19 pandemic data/styles.css#Collapse link needed to collapse back to the original scroll box.
--Timeshifter (talk) 10:34, 30 August 2020 (UTC)

Comment. Dudley Miles and Quantocius Quantotius. Please see User:Timeshifter/Sandbox119. The scrollable table now has a sticky header row that stays visible while scrolling. --Timeshifter (talk) 01:26, 5 September 2020 (UTC)

Sticky header row problem has been solved. See:
Template:COVID-19 pandemic death rates
--Timeshifter (talk) 06:56, 6 September 2020 (UTC)
"Show all" and "Collapse" buttons are all working correctly on all of the partially-collapsed scrolling tables here:
COVID-19 pandemic by country and territory.
--Timeshifter (talk) 04:23, 29 October 2020 (UTC)

Help needed for a timeline of images

Hi, could a wiki table expert help us improve the Timeline of first images of Earth from space, please? There are more details in its Talk page. Thanks! fgnievinski (talk) 05:05, 30 November 2020 (UTC)

Sticky table headers?

Is there a way to make the first row of a table (the header) sticky? So that it stays on screen no matter which part of the table is on screen? Otherwise reading long (and wide) tables is really hard.

--Xerces8 (talk) 14:57, 11 April 2020 (UTC)

Google pulls up some Mediawiki info on it:
https://www.google.com/search?q=mediawiki+Sticky+table+headers
--Timeshifter (talk) 17:22, 11 April 2020 (UTC)
@Xerces8: See also: Phabricator request for floating table headers. --Timeshifter (talk) 08:51, 14 April 2020 (UTC)
@Xerces8 and Timeshifter: I just came here to request the same thing, following my post at Wikipedia talk:Reliable sources/Perennial sources/Archive 3#Technical idea: make the header row of the table sticky. This would be hugely useful for pages like that one. Someone seems to have figured out how to do it at Template:2019–20 coronavirus pandemic data, but that may have involved Herculean amounts of coding (I see they've defined their own custom CSS class, I think). Does anyone have the technical expertise to solve this and add some instructions to this help page, or should we go to WP:VPT? {{u|Sdkb}}talk 00:28, 22 April 2020 (UTC)
Maybe ask at Template talk:2019–20 coronavirus pandemic data. --Timeshifter (talk) 00:37, 22 April 2020 (UTC)
Take a look in Template:2019–20 coronavirus pandemic data/styles.css at .covid-sticky bits. Graeme Bartlett (talk) 12:17, 22 April 2020 (UTC)
Maybe Bawolff can help. --MarioGom (talk) 12:54, 22 April 2020 (UTC)
Generally this stuff isn't mediawiki specific, but works the same as on other websites. See https://developer.mozilla.org/en-US/docs/Web/CSS/position#Sticky_positioning for details on how position:sticky. That said, I'm not sure how to do sticky headers in a table that's not scrollable (using only css and no js). The Covid template works since the entire thing is in a scrollbox. I'm not fully up to date on recent CSS stuff, so maybe there's a method I am unaware of. Bawolff (talk) 01:11, 3 May 2020 (UTC)
GhostInTheMachine talk to me 10:45, 6 September 2020 (UTC)
This code will make the column headers and the row headers sticky. If there are no row headers, then omit the "left:-1px;" and "z-index:1;" styles from the first column header. It works in Chrome and Firefox browsers for Windows desktop and Android mobile devices.
{| class="wikitable" style="max-height:100vh; overflow:auto;"
|-
! scope="col" style="position:-webkit-sticky; position:sticky; top:-1px; left:-1px; z-index:1;" | StickyRowCol
! scope="col" style="position:-webkit-sticky; position:sticky; top:-1px;" | StickyCol
|-
! scope="row" style="position:-webkit-sticky; position:sticky; left:-1px;" | StickyRow
| data
|}
Example table
StickyRowCol StickyCol StickyCol StickyCol StickyCol StickyCol StickyCol StickyCol StickyCol
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
StickyRow data data data data data data data data
Jroberson108 (talk) 22:05, 4 December 2020 (UTC)
Jroberson108. Thanks! I linked to this talk page section from here:
meta:Community Wishlist Survey 2021/Reading/Enable sticky table headers
Feel free to add this collapsed example table to Help:Table.
--Timeshifter (talk) 21:15, 7 December 2020 (UTC)
Also linked from: meta:Community Wishlist Survey 2021/Mobile and apps/Improve horizontal scroll of tables. --Timeshifter (talk) 21:26, 7 December 2020 (UTC)
Timeshifter. I am currently looking into moving the styles to a CSS file to simplify it for users. I have to do more research on the right way to add the CSS file and see if it should have it's own help page. I have the CSS file on my local and it seems to be working well. I am planning on setting class="sticky-headers" on the table with an optional class="sticky-headers-colrow" on a column header that also needs to be row sticky. Jroberson108 (talk) 22:12, 7 December 2020 (UTC)

(unindent). Jroberson108. Does this work with sortable tables too?

Also, I found this sticky table linked from the Phabricator T42763 thread:

And this one with sortable columns:

And class="wikitable floatable-header" here :

--Timeshifter (talk) 03:47, 8 December 2020 (UTC)

Timeshifter. 1) Yes, it works with "sortable"; although, "sortable" doesn't work for mobile, at least on my phone. 2) The RHCP pages aren't using a table, but a chart table (de:Vorlage:Charttabelle), which looks like a table in a desktop browser, but changes in a mobile browser so that row data is displayed vertically as opposed to horizontally with the column headers listed at the top of the entire chart. In certain curcumstances, this might be a better responsive approach compared to a table; although, their header labels aren't sticky at the top and scroll out of view causing a potential disconnect with the data. 3) It looks like "floatable-header" takes a similar approach to what I did in making column headers sticky, but they didn't do anything with the row headers which scroll out of view causing a potential disconnect with the data. Also, their column headers aren't sticky on mobile, just desktop. Jroberson108 (talk) 04:37, 8 December 2020 (UTC)