var all = $('td');
var value, td, comp;
for(var i = 0, ref = all.length; i < ref; i++){
td = $(all[i]);
value = td.text();
console.log(value);
for(var j = 0; j < ref; j++){
comp = $(all[j]);
if(i == j || comp.hasClass('colored')) continue;
if(value == comp.text()){
td.addClass('colored');
comp.addClass('colored');
}
}
}
.colored{
background: #ccc;
}