I am currently working on an HTML table using AngularJS. Below is the HTML code I have written.
Here is the HTML code snippet:
<table>
<tr ng-repeat="data in myResults">
<td style="text-align: center;">{{data.name}}</td>
<td style="text-align: center;">{{data.callerID}}</td>
<td style="text-align: center;">{{data.dataPlan}}</td>
</tr>
</table>
I am fetching the data from the myResults
object and displaying the values in the table through iteration.
My goal is to highlight specific <td>
cells with a color if the value is blank or null during the iteration. For example, if the name
and callerID
have values but dataPlan
is blank, I want to highlight the dataPlan
cell in yellow while displaying the values of name and callerID in their own cells.
I am unsure how to implement a conditional check during iteration to highlight the cell with color if the value is blank/null. Any advice or suggestions would be greatly appreciated.
PS: Please note that I intend to fill the cell with a yellow color if the value is blank or null.