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:
- Template:COVID-19 pandemic data/styles.css
At first I had to add this to get the country column text to align left:
- Template:COVID-19 pandemic death rates by country/styles.css
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
| Country | Confirmed cases | Deaths | Case fatality rate | Deaths per 100,000 population |
|---|---|---|---|---|
| 735 | 42 | 5.7% | 124.32 | |
| 657,129 | 29,068 | 4.4% | 90.87 | |
| 85,911 | 9,898 | 11.5% | 86.66 | |
| 1,199 | 53 | 4.4% | 68.83 | |
| 340,929 | 41,602 | 12.2% | 62.57 | |
| 479,554 | 29,194 | 6.1% | 62.48 | |
| 414,739 | 11,344 | 2.7% | 60.57 | |
| 3,997,865 | 123,780 | 3.1% | 59.09 | |
| 271,515 | 35,497 | 13.1% | 58.74 | |
| 84,532 | 5,820 | 6.9% | 57.15 | |
| 6,113,510 | 185,720 | 3.0% | 56.77 | |
| 610,957 | 65,816 | 10.8% | 52.16 | |
| 94,084 | 2,030 | 2.2% | 48.60 | |
| 117,928 | 5,203 | 4.4% | 45.83 | |
| 331,060 | 30,692 | 9.3% | 45.82 | |
| 633,321 | 20,345 | 3.2% | 40.98 | |
| 115,457 | 6,619 | 5.7% | 38.74 | |
| 29,114 | 1,777 | 6.1% | 36.61 | |
| 74,660 | 6,267 | 8.4% | 36.37 | |
| 44,075 | 884 | 2.0% | 29.95 | |
| 14,600 | 606 | 4.2% | 29.09 | |
| 37,740 | 1,024 | 2.7% | 28.88 | |
| 378,752 | 21,797 | 5.8% | 26.65 | |
| 12,683 | 488 | 3.8% | 26.45 | |
| 630,595 | 14,389 | 2.3% | 24.90 | |
| 131,941 | 9,182 | 7.0% | 24.78 | |
| 42,763 | 2,011 | 4.7% | 23.61 | |
| 439,172 | 9,118 | 2.1% | 20.49 | |
| 6,745 | 124 | 1.8% | 20.40 | |
| 62,526 | 1,924 | 3.1% | 20.07 | |
| 89,891 | 3,721 | 4.1% | 19.11 | |
| 20,517 | 627 | 3.1% | 18.86 | |
| 242,284 | 7,201 | 3.0% | 18.74 | |
| 58,633 | 1,827 | 3.1% | 17.77 | |
| 44,036 | 1,059 | 2.4% | 16.77 | |
| 5,019 | 104 | 2.1% | 16.71 | |
| 95,627 | 1,765 | 1.8% | 16.61 | |
| 75,644 | 2,790 | 3.7% | 16.18 | |
| 85,928 | 689 | 0.8% | 14.27 | |
| 86,478 | 535 | 0.6% | 12.93 | |
| 4,149 | 72 | 1.7% | 12.50 | |
| 52,807 | 190 | 0.4% | 12.11 | |
| 1,001,965 | 17,365 | 1.7% | 12.02 | |
| 317,486 | 3,956 | 1.2% | 11.74 | |
| 25,904 | 731 | 2.8% | 11.38 | |
| 247,411 | 9,322 | 3.8% | 11.24 | |
| 121,464 | 969 | 0.8% | 10.91 | |
| 17,620 | 626 | 3.6% | 10.80 | |
| 9,728 | 296 | 3.0% | 10.33 | |
| 31,581 | 716 | 2.3% | 10.25 | |
| 16,617 | 648 | 3.9% | 9.23 | |
| 43,305 | 453 | 1.0% | 9.06 | |
| 106,032 | 1,588 | 1.5% | 8.69 | |
| 27,969 | 734 | 2.6% | 8.30 | |
| 4,668 | 94 | 2.0% | 8.27 | |
| 273,301 | 6,462 | 2.4% | 7.85 | |
| 4,048 | 41 | 1.0% | 7.54 | |
| 72,141 | 691 | 1.0% | 7.28 | |
| 119,206 | 199 | 0.2% | 7.15 | |
| 896 | 15 | 1.7% | 7.11 | |
| 2,979 | 134 | 4.5% | 6.48 | |
| 4,965 | 83 | 1.7% | 6.34 | |
| 6,622 | 619 | 9.3% | 6.34 | |
| 5,387 | 60 | 1.1% | 6.26 | |
| 8,161 | 336 | 4.1% | 6.09 | |
| 128,833 | 2,705 | 2.1% | 6.06 | |
| 8,140 | 29 | 0.4% | 5.62 | |
| 99,280 | 5,461 | 5.5% | 5.55 | |
| 68,517 | 2,078 | 3.0% | 5.47 | |
| 36,732 | 538 | 1.5% | 5.41 | |
| 1,382 | 41 | 3.0% | 5.26 | |
| 19,138 | 358 | 1.9% | 5.15 | |
| 3,853,406 | 67,376 | 1.7% | 4.98 | |
| 11,034 | 264 | 2.4% | 4.97 | |
| 2,415 | 64 | 2.7% | 4.85 | |
| 10,725 | 191 | 1.8% | 4.67 | |
| 71,540 | 387 | 0.5% | 4.02 | |
| 25,773 | 425 | 1.6% | 4.00 | |
| 38,243 | 1,409 | 3.7% | 3.79 | |
| 15,156 | 250 | 1.6% | 3.74 | |
| 7,089 | 160 | 2.3% | 3.63 | |
| 45,158 | 1,523 | 3.4% | 3.61 | |
| 23,875 | 162 | 0.7% | 3.55 | |
| 226,440 | 3,623 | 1.6% | 3.40 | |
| 1,101 | 13 | 1.2% | 3.39 | |
| 65,453 | 1,216 | 1.9% | 3.38 | |
| 7,844 | 82 | 1.0% | 3.35 | |
| 94 | 3 | 3.2% | 3.12 | |
| 2,958 | 86 | 2.9% | 3.08 | |
| 297,014 | 6,328 | 2.1% | 2.98 | |
| 180,646 | 7,616 | 4.2% | 2.85 | |
| 2,121 | 10 | 0.5% | 2.83 | |
| 26,049 | 678 | 2.6% | 2.71 | |
| 317,528 | 4,351 | 1.4% | 2.70 | |
| 1,931 | 13 | 0.7% | 2.69 | |
| 18,375 | 177 | 1.0% | 2.58 | |
| 10,757 | 273 | 2.5% | 2.54 | |
| 8,538 | 53 | 0.6% | 2.50 | |
| 176 | 7 | 4.0% | 2.44 | |
| 4,668 | 141 | 3.0% | 2.18 | |
| 1,920 | 28 | 1.5% | 2.01 | |
| 13,189 | 823 | 6.2% | 1.97 | |
| 4,628 | 102 | 2.2% | 1.94 | |
| 8,258 | 206 | 2.5% | 1.85 | |
| 2,205 | 34 | 1.5% | 1.81 | |
| 13,743 | 287 | 2.1% | 1.81 | |
| 1,495 | 21 | 1.4% | 1.77 | |
| 1,406 | 34 | 2.4% | 1.76 | |
| 1,305 | 82 | 6.3% | 1.70 | |
| 12,415 | 292 | 2.4% | 1.68 | |
| 19,460 | 415 | 2.1% | 1.65 | |
| 1,085 | 31 | 2.9% | 1.47 | |
| 6,638 | 206 | 3.1% | 1.43 | |
| 48,883 | 398 | 0.8% | 1.38 | |
| 4,712 | 62 | 1.3% | 1.33 | |
| 1,626 | 44 | 2.7% | 1.28 | |
| 34,493 | 581 | 1.7% | 1.13 | |
| 69,619 | 1,327 | 1.9% | 1.05 | |
| 42,437 | 327 | 0.8% | 0.99 | |
| 5,579 | 175 | 3.1% | 0.96 | |
| 2,029 | 71 | 3.5% | 0.93 | |
| 44,658 | 276 | 0.6% | 0.93 | |
| 41,649 | 251 | 0.6% | 0.89 | |
| 4,126 | 98 | 2.4% | 0.86 | |
| 427 | 7 | 1.6% | 0.84 | |
| 2,683 | 24 | 0.9% | 0.82 | |
| 356 | 10 | 2.8% | 0.79 | |
| 54,409 | 846 | 1.6% | 0.77 | |
| 8,654 | 69 | 0.8% | 0.76 | |
| 15,023 | 196 | 1.3% | 0.75 | |
| 4,196 | 81 | 1.9% | 0.70 | |
| 144 | 3 | 2.1% | 0.70 | |
| 2,802 | 126 | 4.5% | 0.66 | |
| 3,310 | 98 | 3.0% | 0.65 | |
| 20,644 | 329 | 1.6% | 0.64 | |
| 4,042 | 33 | 0.8% | 0.61 | |
| 54,463 | 1,027 | 1.9% | 0.52 | |
| 1,548 | 19 | 1.2% | 0.51 | |
| 1,017 | 77 | 7.6% | 0.50 | |
| 56,860 | 27 | 0.0% | 0.48 | |
| 9,479 | 59 | 0.6% | 0.48 | |
| 18,161 | 117 | 0.6% | 0.47 | |
| 1,759 | 22 | 1.3% | 0.45 | |
| 2,532 | 47 | 1.9% | 0.43 | |
| 9,360 | 128 | 1.4% | 0.41 | |
| 1,434 | 30 | 2.1% | 0.38 | |
| 2,777 | 112 | 4.0% | 0.36 | |
| 2,194 | 40 | 1.8% | 0.35 | |
| 89,953 | 4,727 | 5.3% | 0.34 | |
| 10,114 | 259 | 2.6% | 0.31 | |
| 1,176 | 69 | 5.9% | 0.31 | |
| 1,370 | 55 | 4.0% | 0.28 | |
| 1,724 | 6 | 0.3% | 0.27 | |
| 2,161 | 15 | 0.7% | 0.15 | |
| 4,218 | 17 | 0.4% | 0.14 | |
| 4,117 | 25 | 0.6% | 0.08 | |
| 3,427 | 58 | 1.7% | 0.08 | |
| 3,112 | 32 | 1.0% | 0.07 | |
| 471 | 5 | 1.1% | 0.06 | |
| 3,101 | 12 | 0.4% | 0.06 | |
| 509 | 21 | 4.1% | 0.04 | |
| 1,046 | 34 | 3.3% | 0.04 | |
| 489 | 7 | 1.4% | 0.03 | |
| 1,976 | 571 | 28.9% | nan | |
| 2,898 | 120 | 4.1% | nan | |
| 3,067 | 97 | 3.2% | nan | |
| 2,337 | 50 | 2.1% | nan | |
| Diamond Princess | 712 | 13 | 1.8% | nan |
| 995 | 6 | 0.6% | nan |