<table> <colgroup style =" width:50px"></colgroup> @{ var rowColor = "D9E6C4"; } <tr> @foreach (var item in Model.Tasks) { if (item.SStart == null) { rowColor = "#fff8c6"; } else if (item.SStart != null && item.SEnd == null) { rowColor = "#c0c0c0";} //="background-color:silver">} else if (item.SEnd != null && item.SCert == null) { rowColor ="#5cb3ff";} //"background-color:blue">} else if (item.SCert != null) { rowColor = "#4aa02c";} //style="background-color:green">} //now add the data <td style="background-color:@rowColor;" > </td> </tr> }; </table>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)