I am facing an issue with styling a table that has the following class applied:
<table class="table table-striped table-borderless nowrap">
Specifically, I want to change the background color of certain rows based on user conditions like this:
<tr class="@(item.Assigneee == UserSession.User.Id ? "alert alert-primary" : " ")">
However, despite using !important in my CSS, the table class background color still takes precedence over the individual row styling. Even though the class is added to the row:
<tr class="alert alert-primary odd" role="row">
The background color specified in the original table class still shows up, as seen in this snippet of code:
.table-striped tbody tr:nth-of-type(odd) {
background-color: rgba(0, 0, 0, 0.05);
}
If you would like to see a visual representation of the issue, click on this link: https://i.sstatic.net/K2qBo.png