==Tables with background colors set per row==
I want to be able to add **//class=mw-datatable//** to tables, and **not lose the background colors set for rows. **
Please see **[[https://en.wikipedia.org/wiki/User:Timeshifter/Sandbox152 | User:Timeshifter/Sandbox152]].** The table excerpt there is from the "Top scorers" section of **[[https://en.wikipedia.org/w/index.php?title=Denmark_men%27s_national_handball_team&oldid=1028061591#Top_scorers | this version]]** of **[[https://en.wikipedia.org/wiki/Denmark_men%27s_national_handball_team#Top_scorers | Denmark men's national handball team]]**. It is common in many sport statistics tables to add a background color to some of the rows. In this table excerpt the **rows** for **still active national team players** are **highlighted.**
The first table in the sandbox is **//without// class=mw-datatable.** The second table is **//with// class=mw-datatable. ** You can see how the class removes the background colors for rows and substitutes the white background color of the rest of the table data cells.
==Tables with background colors set per data cell==
class=mw-datatable respects the inline background color when that **color is set per data cell.** For example; on the many tables that use a color gradient template on a per cell basis. For example; see the rate column in the main table in **[[https://en.wikipedia.org/w/index.php?title=List_of_countries_by_intentional_homicide_rate&oldid=1026393424#By_country,_region,_or_dependent_territory | this version]]** of **[[https://en.wikipedia.org/wiki/List_of_countries_by_intentional_homicide_rate#By_country,_region,_or_dependent_territory | List of countries by intentional homicide rate]].** That main table uses **class="mw-datatable wikitable"** and it is not a problem. The background colors set per cell remain.
==Why it is important==
class=mw-datatable (usually combined with class=wikitable) is used more and more. It produces a white background color that is preferred by many for statistic tables. Due to the better contrast and readability for many people. Versus the light gray background color of class=wikitable used alone. Plus class=mw-datatable will highlight the row that the cursor hovers over. Making it easier to scan across that row, especially if it is a long row.
Also, if this is fixed, then this row numbers auxiliary template can be used on more tables, especially sport statistic tables: **[[https://en.wikipedia.org/wiki/Template:Static_row_numbers_table | Template:Static row numbers table]].** It uses **class="mw-datatable wikitable".** This template is used with: **[[https://en.wikipedia.org/wiki/Template:Static_row_numbers | Template:Static row numbers]].** The 2 templates together make setting up row numbers on a table very fast.