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:41, 28 August 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)

Set table column width to 150px

Here's the code. Does anybody know how to set the width of column 3 to 150px? "width: 150px" for column 3 is in the code at the moment, but the browser ignores "width" and "max-width" in any column. The browser only obeys "min-width". I tried "table-layout: fixed", "word-wrap: break-word", and some other things, not having luck so far. Thanks. –Novem Linguae (talk) 16:43, 6 January 2021 (UTC)

Novem Linguae, if you look at the thread just above ("Use of em and % values in preference to px values"), you'll see Warning: Setting specific pixel sizes is deprecated, as it interferes with the ability of the browser to adjust content to suit the browser window, device size, user-end font size limits, and other constraints. It is strongly preferred to use relative sizes, in percentage or em values... Schazjmd (talk) 17:45, 6 January 2021 (UTC)
@Novem Linguae: The cells in column 3 use {{nowrap}}. This forces the column to be at least as wide as "People's Front for Democracy and Justice", so setting a smaller width has no effect. Browsers (at least my Firefox) will not respect a large width if it forces the table to be wider than the window, so setting a very large width in column 3 may have no affect unless the window is really wide or you zoom out a lot. On my screen at standard zoom this all means that width is effectively ignored in that particular column of that particular table. PrimeHunter (talk) 22:48, 6 January 2021 (UTC)
PrimeHunter, deleting {{nowrap}} worked perfectly. Thank you. –Novem Linguae (talk) 03:55, 9 January 2021 (UTC)

Showing extra info when clicking a cell

Is it possible to show more information when clicking a cell in the table? Barecode (talk) 20:27, 5 January 2021 (UTC)

It is Bad Form to have hidden content without a clear indication, but the cell could have extra, hidden content and a [show] button:
     
{| class="wikitable"
|+ Caption text
|-
| Example || Example || Example
|-
| Example
| Example
{{collapse top|bg="silver"|title=More ...}}
Lots more information
{{collapse bottom}}
| Example
|-
| Example || Example || Example
|}
Caption text
Example Example Example
Example Example
More ...

Lots more information

Example
Example Example Example
See {{Collapse top}} for more details — GhostInTheMachine talk to me 18:53, 11 January 2021 (UTC)

Use of em and % values in preference to px values

Hello people,

Under #HTML attributes in this article there is this advice:

Doesn't this mean the various examples in this article should comply with that advice?

I can go through and amend if there is no objection and someone can check what I do. But if someone else prefers to do it I won't object.  ;-)

Cheers, Simon – SCHolar44 🇦🇺 💬 at 11:57, 18 December 2020 (UTC)

SCHolar44, the column width section states Warning: Setting specific pixel sizes is deprecated, as it interferes with the ability of the browser to adjust content to suit the browser window, device size, user-end font size limits, and other constraints. It is strongly preferred to use relative sizes, in percentage or em values.. I came here to see if there was a recent discussion that mentioned it, because the page gives examples using pixel sizes. There's a post from several years ago asking about the same thing, so it's been since at least 2016, but I can't find a discussion that led to the decision. Anyway, I agree that the page should be cleaned up to only use examples that comply with the recommended/strongly preferred guidance. Schazjmd (talk) 14:56, 20 December 2020 (UTC)
Note: I posted about this conversation on Wikipedia_talk:Manual_of_Style/Tables to encourage more editors to weigh in. Schazjmd (talk) 15:21, 20 December 2020 (UTC)
In Firefox browser I frequently click the zoom buttons in one of the top toolbars to increase or decrease the text size. But I also have "Zoom text only" checked in View menu > Zoom.
So I would not want em values used for images, or border width, or border spacing, or margins, padding, etc.. In other words anything non-text related.
But em is fine by me for widths of columns and tables. Since that is related to text sizing. --Timeshifter (talk) 05:02, 3 January 2021 (UTC)
Many thanks, Schazjmd and Timeshifter. I've taken your comments on board. Cheers, Simon – SCHolar44 🇦🇺 💬 at 05:50, 6 January 2021 (UTC)
Dear colleagues,
I have gone through the article, as promised, with the following actions:
  • changed px values to em values (multiplication factor used: x0.077) wherever px values had been applied to content that was not text-related, i.e. images, border width, border spacing, margins, padding etc
  • changed em values to px where they had been applied to images, border width, border spacing, margins, padding etc
  • drafted a notice for the introduction to the article and updated the existing (upper) one in the section headed "HTML attributes".
I have pasted the amended article into one of my User pages. To see the changes, just copy the amended article, go into Edit mode in the Help:Table article, Select All and delete, paste in the amended article, click Show preview then Show changes. When you're finished, click on Cancel.
Two questions:
  • You'll see that in the first place where I have changed the specification to em values, in the code under the heading "Multiplication table", I have only changed to ems for the width value, not the height. However, I see the example under the heading "Width, height" specifies style="width: 60%; height: 14em;". Is there a reason to use em or % for the height?
  • Should we word the advice to indicate that % or em specifications are only needed for width values?
Please examine/critique carefully, and of course change at your will!
I look forward to seeing your comments. Cheers, Simon – SCHolar44 🇦🇺 💬 at 03:21, 18 January 2021 (UTC)
undent: Here is a diff.
changed em values to px where they had been applied to images, border width, border spacing, margins, padding etc This is the wrong direction. It's bad web design and Timeshifter's opinion on the particular matter is strictly his personal preference. The only thing that is reasonable is that images must be specified in pixel values (this is a web requirement, essentially). (I would also say it's generally not idiomatic to specify border widths in anything but pixels, but that's a question of idiom and not requirement or suggestion.)
Generally, what should be suggested is that inline styling in general should be avoided. class="wikitable" is usually sufficient. Where desired, inline styling should be kept to a minimum. This allows the particular skin in which the table is displayed, and the browser, and lastly the user with his own stylesheets whether onwiki or in his browser agent, maximum flexibility to do what it will to fit the content to the screen. --Izno (talk) 05:44, 18 January 2021 (UTC)
Hmm, I hear what you're saying, Izno. Your knowledge is obviously far in advance of mine; I don't have the background to implement explicitly what you have opined as over-arching principles. I have therefore decided not to carry this further and to delete my draft, knowing that your comparison is still available should anyone (or you) be interested to give clearer guidance on the px/em/% question. SCHolar44 🇦🇺 💬 at 11:22, 18 January 2021 (UTC)

tables for mobile editors

there would be appreciated some additional guidelines on table usage, for mobile editors..have posted a comment indicating some recent difficulties here Wikipedia:Village_pump_(technical)/Archive_187#wikitable_width..many thanks Gfigs (talk) 09:50, 29 January 2021 (UTC)

Collapsible Sections

Is there a way to make a table in which one row is collapsible and can be made visible by clicking [show] while other rows are always visible? Krisgabwoosh (talk) 20:33, 8 February 2021 (UTC)

parameters and auto-sorting tables

What do the 'create', 'order', 'numeric', and 'ascending'/'descending' parameters and more mean, how do they function, and how do I use 'colspan' and 'rowspan', and use multiple headers or place headers in different locations on Module:AutosortTable, and how do I auto-sort tables and use the 'create', 'order', 'numeric', and 'ascending'/'descending' and the other parameters on tables? -- PK2 (talk) 10:35, 19 August 2020 (UTC)

@PK2: Strictly speaking none of those are parameters. Modules follow the format of
{{#invoke: Module_name | function_name | arg1 | arg2 | arg3 ...}}
see mw:Extension:Scribunto for more details.
Hence, create is the name of the function being called; order, numeric, and descending (there is no ascending) are arguments.
Order is for the sorting preference it takes a coma separated list of column numbers; if two values are the same the next lower preference is used.
Numeric also accepts a coma separated list of column numbers; it designates which use numeric sorting.
Descending is likewise a coma separated list of column numbers it inverts the normal sort order which is ascending by default.
I'm not clear why you would want to use rowspan. Recalling that, post-sorting, any rowspanning cells are cut into individual rows with repeated content and remain that way even if the original sort order is restored.
You autosort tables by converting them into the format used by this module (see Module:AutosortTable/testcases for examples) although in most cases I suspect you're better off using a standard sortable wikitable.
I apologize if I haven't answered your question in full as I'm not sure I fully understood it; if you are looking for someone to write up the documentation for this module I can potentially do that but my time for this is quite limited at the moment (and I have quite a few things on my plate already) so it may be some time before I can get around to it.(please ping on reply)
𝒬𝔔 16:58, 28 August 2020 (UTC)
P.S. Please allow a few days for replies, I can usually respond within the week.
Hello @PK2: I don't know if you (or possibly others) still care, but I have (somewhat) updated the in-code documentation of the parameters you mentioned (while adding a couple of new items). I have an urge to create proper documentation, that's on an actual /doc page and isn't so terse, but I haven't done that yet (and it may be a while before I do).
In case you haven't already figured out what you were wondering about, take a look at what I've done and see if it helps. I'd welcome any feedback. Regards, — JohnFromPinckney (talk) 23:51, 21 February 2021 (UTC)

I have a few questions for everyone:

  1. Can you please make it possible for me to use parameters like 'colspan', 'rowspan', 'nosort' and 'data-sort-type', use multiple headers or place headers in different locations, style all or individual cells, rows, columns or headers, and replace the module equivalent of ! scope="row" with | scope="row" on Module:AutosortTable?
  2. How do I auto-sort tables and use the 'create', 'order', 'numeric' 'ascending'/'descending', 'hidden' and the other parameters, and style all headers or individual columns on standard tables?
  3. Why would someone use the 'hidden' parameter on tables?

Here is an example of a table:

Rank Wikipedia project Language Script WP
code
Active
users (log)
Launch date Logo
English name Native name
1 English Wikipedia English Latn en 5
Wikipedia logo showing "Wikipedia: The Free Encyclopedia" in
2 French Wikipedia Wikipédia en français French Latn fr 4
Wikipedia logo showing "Wikipedia: The Free Encyclopedia" in
3 German Wikipedia Deutschsprachige Wikipedia German Latn de 4
Wikipedia logo showing "Wikipedia: The Free Encyclopedia" in
4 Spanish Wikipedia Wikipedia en español Spanish Latn es 4
Wikipedia logo showing "Wikipedia: The Free Encyclopedia" in
5 Japanese Wikipedia ウィキペディア日本語版
(Wikipedia nihongo-ban)
Japanese Jpan ja 4
Wikipedia logo showing "Wikipedia: The Free Encyclopedia" in
Rank English name Native name Language Script WP
code
Active
users (log)
Launch date Logo
Wikipedia project

-- PK2 (talk) 08:36, 28 February 2021 (UTC)

Hi, PK2. Let me address your questions in order:
  1. I'm not personally inclined to add support for rowspan/colspan, as I'm not completely clear on what all their effects on accessibility are. More relevantly, how is a table supposed to be sorted when cells are joined using such span attributes? I don't think you need nosort for AutosortTable; just don't specify sorting on that column. The styling of rows and columns can be done now, if you only knew how (see my #2). And something (else) I don't know: why would you want to have | scope="row" in an accessible table?
  2. I guess your repeated question here is the answer I was waiting for from you: the documention I added is not sufficient to explain these parameters' use. Okay, I'll try to get up some time/energy and create a dedicated documentation page, with better examples.
  3. This one, I can help you on. Consider a table with different data columns (duh), one or more of which you do not (at the moment) want displayed on a given page (like maybe a list of all the Wikipedia versions, but without the magnitude of the user base displayed). However, you do want the table sorted by one of those hidden columns (for example, with EN-WP at the top, 'cause it's the biggest/has the most users).
That certainly is an example of a table. Um, what should we do with it? — JohnFromPinckney (talk) 15:36, 28 February 2021 (UTC)