How to make function give red color to rows have different values ?

8 views
Skip to first unread message

ahmed elbarbary

unread,
Feb 5, 2020, 8:24:28 PM2/5/20
to Angular and AngularJS discussion
I work on angular 7
I already display data on dynamic table not static
I need  when at least one cell from row  different from each others
then give red font to full row 

second row give red color because it have at least one  cell as 15 different from another cell on row
third row have red color because not value on row as anothers 12 ,13,15,17
so How to make function do that by jquery or java script or type script do red color for row if it have at least different cell value


img for red color different.png



<!DOCTYPE html>
<html>
<body>
<table border="1">
<col width="500">
<col width="500">
<col width="500">
<col width="500">
<tr bgcolor="#6699FF" width="100%">
   
<th>Part1</th>
   
<th>Part2</th>
   
<th>Part3</th>
   
<th>Part4</th>
<tr>
   
<td>12</td>
   
<td>12</td>
   
<td>12</td>
   
<td>12</td>
</tr>
<tr>
   
<td>12</td>
   
<td>15</td>
   
<td>12</td>
   
<td>12</td>
</tr>
<tr>
   
<td>17</td>
   
<td>15</td>
   
<td>13</td>
   
<td>12</td>
</tr>
</table>


<button id="button">Click Me</button>
</body>


</html>

Reply all
Reply to author
Forward
0 new messages