I would like to change the color in the (td) field [change color - change / transfer to a different css class?]
Condition:
The condition comes from the "if" query. if (sb == true) then nothing changes, if (sb == false) "[else]"
then the css class in (td class="InputsForUserColor1") may change to class="InputsForUserColor1Change".
I note
(td class="InputsForUserColor2") is unchanged
Code html (razor/C#):
the variable "sb" is outside "if", assumes a different value
@for (int sth = 0; sth< ViewBag.sth; sth++)
{
if (sb == true){
varSth = "00:00";
}
else{
varSth = "20:00";
}
@for (int sthElse = 0; sthElse< ViewBag.sthElse; sthElse++)
{
if (nr_columns == 2){
<td id="td01" class="InputsForUserColor1"></td>
}
if (nr_columns == 3){
<td id="td01" class="InputsForUserColor2"></td>
}
}
}
CSS:
.InputsForUserColor1, area {
background-color: papayawhip;
border: hidden;
align-content: center;
align-items: center;
vertical-align: central;
}
.InputsForUserColor1Change, area {
background-color: white;
border: hidden;
align-content: center;
align-items: center;
vertical-align: central;
}
personally I didn't write it because I don't know how to approach it
What I have tried:
personally I didn't write it because I don't know how to approach it