I've got a solution at my end:
Here's your code submitted modification:
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$( document ).ready(function() {
MakeColorForDifferentContent();
});
function MakeColorForDifferentContent (){
$("table tr").each((row, tr) => {
var tempValue = $($(tr).find('td:first-child')).text();
var tds = $(tr).find('td:not(:first-child)');
tds.each((col, td) => {
if($(td).text() !== tempValue){
return true;
}
});
if((row % 2) == 0) {
$(tr).css('color', 'red');
$(tr).css('background-color', 'lightgrey');
}
});
}
</script>
</head>
<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>12</td>
<td>12</td>
</tr>
<tr>
<td>17</td>
<td>15</td>
<td>12</td>
<td>12</td>
</tr>
</table>
</body>
</html>
Apparently, here's what this code is intended to do. When .each(...) loop is executed for each row, it checks if the row index value is even or odd (e.g. if the division of the index value by 2 gives no reminder). If so, the css(...) method is called, changing the css color attributes to the desired background and text color, so that 0,2,4,6,8... rows are colored with lightgrey background and red text.
The code you submitted will not work, because it doesn't perform a check whether the background and text color for the current row must be changed.
Enjoy! :)