User:Timeshifter/Sandbox228

Problem with class=sorttop
class=sorttop rows can become part of the sticky header. This only happens after sorting.

This table excerpt is adapted from the 2021 table in this version of COVID-19 pandemic deaths.

The static rows at the top under the main header row are rows of data that shouldn't sort, and shouldn't have row numbers.
 * class=static-row-header prevents row numbers on those rows.
 * class=sorttop prevents the row from sorting.

See the yellow highlighted lines in the wikitext below.

Solution for single row header
This solution only works for a single row header. The number of lines in that row does not matter. This does not work for multi-row headers.

The solution is to use class=sticky instead of class=sticky-header
 * class=sticky goes in a different part of the wikitext.

See the yellow highlighted line in the wikitext below.

Solution for single row header. Narrower table
See: User:Timeshifter/Sandbox233. A place to test if it works without a wider table on the page.

For portrait view on cell phones:

| | | | | |

| | | | | |

| | | | | |

| | | | |

| | | | | | | |

| | | | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | |

| | | | | | | |

| | | | | | | |