Jump to content

User:Timeshifter/Sandbox119

From Wikipedia, the free encyclopedia

Scrollable table below now has sticky header row that stays visible while scrolling. See also:

See also: User:Timeshifter/Sandbox118

Modeled on this template:

Trying to only use its external style sheet:

At first I had to add this to get the country column text to align left:

The only part of the CSS from the link just above that was needed:

/* styling for first column */
.covid19-deathbycountry tr>:first-child {
	text-align:left;
}

A variation of it has been added to Template:COVID-19 pandemic data/styles.css

/* Column of country names left aligned when names are in first column. */
/* For John Hopkins table. */
.covid19-countrynames tr>:first-child {
	text-align:left;
}

So now the sandbox table, and the template table work fine. See i:

Table is updated by copying just the data wikitext (no header wikitext) from here:

Hidden notes in the template below show where to copy and paste the data wikitext.

{{nowrap}} has been removed from the caption. Non-breaking spaces are now in the date: 5 September 2020. Caption goes to 2 lines when zoomed high enough. Caption still disappears when scrolling. Regardless of the caption length, at a high enough zoom level the table extends beyond its scrollbox size horizontally. This happens when the header words are wide enough. These words: confirmed, population. Also, the country names.

Scrollable table with sticky header row

[edit]
Country Confirmed cases Deaths Case fatality rate Deaths per 100,000 population
 San Marino 735 42 5.7% 124.32
 Peru 657,129 29,068 4.4% 90.87
 Belgium 85,911 9,898 11.5% 86.66
 Andorra 1,199 53 4.4% 68.83
 United Kingdom 340,929 41,602 12.2% 62.57
 Spain 479,554 29,194 6.1% 62.48
 Chile 414,739 11,344 2.7% 60.57
 Brazil 3,997,865 123,780 3.1% 59.09
 Italy 271,515 35,497 13.1% 58.74
 Sweden 84,532 5,820 6.9% 57.15
 United States 6,113,510 185,720 3.0% 56.77
 Mexico 610,957 65,816 10.8% 52.16
 Panama 94,084 2,030 2.2% 48.60
 Bolivia 117,928 5,203 4.4% 45.83
 France 331,060 30,692 9.3% 45.82
 Colombia 633,321 20,345 3.2% 40.98
 Ecuador 115,457 6,619 5.7% 38.74
 Ireland 29,114 1,777 6.1% 36.61
 Netherlands 74,660 6,267 8.4% 36.37
 Armenia 44,075 884 2.0% 29.95
 North Macedonia 14,600 606 4.2% 29.09
 Moldova 37,740 1,024 2.7% 28.88
 Iran 378,752 21,797 5.8% 26.65
 Kosovo 12,683 488 3.8% 26.45
 South Africa 630,595 14,389 2.3% 24.90
 Canada 131,941 9,182 7.0% 24.78
 Switzerland 42,763 2,011 4.7% 23.61
 Argentina 439,172 9,118 2.1% 20.49
 Luxembourg 6,745 124 1.8% 20.40
 Honduras 62,526 1,924 3.1% 20.07
 Romania 89,891 3,721 4.1% 19.11
 Bosnia and Herzegovina 20,517 627 3.1% 18.86
 Iraq 242,284 7,201 3.0% 18.74
 Portugal 58,633 1,827 3.1% 17.77
 Kyrgyzstan 44,036 1,059 2.4% 16.77
 Montenegro 5,019 104 2.1% 16.71
 Dominican Republic 95,627 1,765 1.8% 16.61
 Guatemala 75,644 2,790 3.7% 16.18
 Oman 85,928 689 0.8% 14.27
 Kuwait 86,478 535 0.6% 12.93
 Suriname 4,149 72 1.7% 12.50
 Bahrain 52,807 190 0.4% 12.11
 Russia 1,001,965 17,365 1.7% 12.02
 Saudi Arabia 317,486 3,956 1.2% 11.74
 El Salvador 25,904 731 2.8% 11.38
 Germany 247,411 9,322 3.8% 11.24
 Israel 121,464 969 0.8% 10.91
 Denmark 17,620 626 3.6% 10.80
 Albania 9,728 296 3.0% 10.33
 Serbia 31,581 716 2.3% 10.25
 Bulgaria 16,617 648 3.9% 9.23
 Costa Rica 43,305 453 1.0% 9.06
 Kazakhstan 106,032 1,588 1.5% 8.69
 Austria 27,969 734 2.6% 8.30
 Eswatini 4,668 94 2.0% 8.27
 Turkey 273,301 6,462 2.4% 7.85
 Cape Verde 4,048 41 1.0% 7.54
 Belarus 72,141 691 1.0% 7.28
 Qatar 119,206 199 0.2% 7.15
 São Tomé and Príncipe 896 15 1.7% 7.11
 Slovenia 2,979 134 4.5% 6.48
 Equatorial Guinea 4,965 83 1.7% 6.34
 Hungary 6,622 619 9.3% 6.34
 Djibouti 5,387 60 1.1% 6.26
 Finland 8,161 336 4.1% 6.09
 Ukraine 128,833 2,705 2.1% 6.06
 Maldives 8,140 29 0.4% 5.62
 Egypt 99,280 5,461 5.5% 5.55
 Poland 68,517 2,078 3.0% 5.47
 Azerbaijan 36,732 538 1.5% 5.41
 Guyana 1,382 41 3.0% 5.26
 Paraguay 19,138 358 1.9% 5.15
 India 3,853,406 67,376 1.7% 4.98
 Norway 11,034 264 2.4% 4.97
 Estonia 2,415 64 2.7% 4.85
 Croatia 10,725 191 1.8% 4.67
 United Arab Emirates 71,540 387 0.5% 4.02
 Czech Republic 25,773 425 1.6% 4.00
 Afghanistan 38,243 1,409 3.7% 3.79
 Libya 15,156 250 1.6% 3.74
 Mauritania 7,089 160 2.3% 3.63
 Algeria 45,158 1,523 3.4% 3.61
 Palestine 23,875 162 0.7% 3.55
 Philippines 226,440 3,623 1.6% 3.40
 Belize 1,101 13 1.2% 3.39
 Morocco 65,453 1,216 1.9% 3.38
 Namibia 7,844 82 1.0% 3.35
 Antigua and Barbuda 94 3 3.2% 3.12
 Lithuania 2,958 86 2.9% 3.08
 Pakistan 297,014 6,328 2.1% 2.98
 Indonesia 180,646 7,616 4.2% 2.85
 Iceland 2,121 10 0.5% 2.83
 Australia 26,049 678 2.6% 2.71
 Bangladesh 317,528 4,351 1.4% 2.70
 Malta 1,931 13 0.7% 2.69
 Lebanon 18,375 177 1.0% 2.58
 Greece 10,757 273 2.5% 2.54
 Gabon 8,538 53 0.6% 2.50
 Barbados 176 7 4.0% 2.44
 Nicaragua 4,668 141 3.0% 2.18
 Trinidad and Tobago 1,920 28 1.5% 2.01
 Sudan 13,189 823 6.2% 1.97
 Congo 4,628 102 2.2% 1.94
 Haiti 8,258 206 2.5% 1.85
 Guinea-Bissau 2,205 34 1.5% 1.81
 Senegal 13,743 287 2.1% 1.81
 Cyprus 1,495 21 1.4% 1.77
 Latvia 1,406 34 2.4% 1.76
 Liberia 1,305 82 6.3% 1.70
 Zambia 12,415 292 2.4% 1.68
 Cameroon 19,460 415 2.1% 1.65
 Lesotho 1,085 31 2.9% 1.47
 Zimbabwe 6,638 206 3.1% 1.43
 Venezuela 48,883 398 0.8% 1.38
 Central African Republic 4,712 62 1.3% 1.33
 Uruguay 1,626 44 2.7% 1.28
 Kenya 34,493 581 1.7% 1.13
 Japan 69,619 1,327 1.9% 1.05
 Uzbekistan 42,437 327 0.8% 0.99
 Malawi 5,579 175 3.1% 0.96
 Sierra Leone 2,029 71 3.5% 0.93
 Ghana 44,658 276 0.6% 0.93
 Nepal 41,649 251 0.6% 0.89
 Cuba 4,126 98 2.4% 0.86
 Comoros 427 7 1.6% 0.84
 Jamaica 2,683 24 0.9% 0.82
 Mauritius 356 10 2.8% 0.79
 Ethiopia 54,409 846 1.6% 0.77
 Tajikistan 8,654 69 0.8% 0.76
 Madagascar 15,023 196 1.3% 0.75
 Tunisia 4,196 81 1.9% 0.70
 Brunei 144 3 2.1% 0.70
 Mali 2,802 126 4.5% 0.66
 Somalia 3,310 98 3.0% 0.65
 South Korea 20,644 329 1.6% 0.64
 Slovakia 4,042 33 0.8% 0.61
 Nigeria 54,463 1,027 1.9% 0.52
 Georgia 1,548 19 1.2% 0.51
 Chad 1,017 77 7.6% 0.50
 Singapore 56,860 27 0.0% 0.48
 Guinea 9,479 59 0.6% 0.48
 Ivory Coast 18,161 117 0.6% 0.47
 New Zealand 1,759 22 1.3% 0.45
 South Sudan 2,532 47 1.9% 0.43
 Malaysia 9,360 128 1.4% 0.41
 Togo 1,434 30 2.1% 0.38
 Angola 2,777 112 4.0% 0.36
 Benin 2,194 40 1.8% 0.35
 China 89,953 4,727 5.3% 0.34
 DR Congo 10,114 259 2.6% 0.31
 Niger 1,176 69 5.9% 0.31
 Burkina Faso 1,370 55 4.0% 0.28
 Botswana 1,724 6 0.3% 0.27
 Jordan 2,161 15 0.7% 0.15
 Rwanda 4,218 17 0.4% 0.14
 Mozambique 4,117 25 0.6% 0.08
 Thailand 3,427 58 1.7% 0.08
 Uganda 3,112 32 1.0% 0.07
 Papua New Guinea 471 5 1.1% 0.06
 Sri Lanka 3,101 12 0.4% 0.06
 Tanzania 509 21 4.1% 0.04
 Vietnam 1,046 34 3.3% 0.04
 Taiwan 489 7 1.4% 0.03
 Yemen 1,976 571 28.9% nan
 Syria 2,898 120 4.1% nan
 Gambia 3,067 97 3.2% nan
 Bahamas 2,337 50 2.1% nan
Diamond Princess 712 13 1.8% nan
 Burma 995 6 0.6% nan