Something like below will work. In addition, I recommend using <thead>and <tbody>in <table>for proper markup. Update the corrected function below to check the values of other lines; as soon as another value is met, it is <tr>updated by the corresponding class.
: http://jsfiddle.net/kaCAF/4/
<script type="text/javascript">
$(document).ready(function() {
$('#myTable tbody tr').each(function() {
$(this).find('td').each(function() {
var $val = $(this).text();
$(this).parent().find('td').each(function() {
if ($(this).text() != $val) {
$(this).parent().addClass('different');
return false;
}
});
});
});
});
</script>
<table id="myTable" border="1">
<thead>
<tr><th>Col1</th><th>Col2</th><th>Col3</th></tr>
</thead>
<tbody>
<tr><td>Val 1</td><td>Val 1</td><td>Val 2</td></tr>
<tr><td>Val 1</td><td>Val 2</td><td>Val 2</td></tr>
<tr><td>Val 3</td><td>Val 3</td><td>Val 3</td></tr>
<tr><td>Val 123</td><td>Val 123</td><td>Val 123</td></tr>
</tbody>
</table>