Click here to Skip to main content
14,739,784 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
problem

How to give red color for rows on html table that have different values on same row ?

I need when at least one cell from row different from each others

then give red font to full row

if you see below row that have same value on all cell not changed color .

I need function give red color for row that have at least one value different from others on same row

so How to make function do that by jquery or java script do red color for row if it have

at least different cell value .

rows have different values give red rows font .

final result as below
File sharing and storage made simple[^]

What I have tried:

<!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>
Posted
Updated 5-Feb-20 22:50pm
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900