Mam trywialny problem, z którym jakoś nie mogę sobię poradzić

Mam dwie tabelki oparte na divach. Jak zrobić aby po najechaniu kursorem na wiersz w pierwszej tabelce podświetlił się wiersz w drugiej tabeli (równocześnie)?
div:hover { background: yellow; }
tr:hover { background: yellow; }
$(document).ready(function(){ $('#jeden').hover(function(){ $('.jeden').css('background', 'yellow'); }), function(){ $('.jeden').css('background', 'white'); }) })
$(document).ready(function(){ $('#jeden').hover(function(){ $('.jeden').css('background', 'yellow'); }, function(){ $('.jeden').css('background', 'white'); }) $('#dwa').hover(function(){ $('.dwa').css('background', 'yellow'); }, function(){ $('.dwa').css('background', 'white'); }) })
tabela1 = $('#tabela1 tr'); tabela2 = $('#tabela2 tr'); tabela1.hover(function(){ //twoje wiersze w piersze tabela2.eq($(this).index()).addClass('highlight'); //klasa highlight w której definiujesz styl podświetlenia function(){ tabela2.eq($(this).index()).removeClass('highlight'); });
tabela1 = $('#tabela1 tr'); //definiuje wszystkie wiersze w pierwszej tabeli (masz to na divach - nie wiem co stosujesz zamiast 'tr') tabela2 = $('#tabela2 tr'); //jak wyżej tabela1.hover( function(){ $(this).addClass('highlight'); //podswietla najechany element w tabeli 1 tabela2.eq($(this).index()).addClass('highlight'); // podswietla odpowiadający element w drugiej tabeli }, function(){ //usuwa podświetlenie $(this).removeClass('highlight'); tabela2.eq($(this).index()).removeClass('highlight'); } ); // I na odwrót tabela2.hover( function(){ //twoje wiersze w piersze $(this).addClass('highlight'); //podswietla najechany element w tabeli 1 tabela1.eq($(this).index()).addClass('highlight'); // podswietla odpowiadający element w drugiej tabeli }, function(){ //usuwa podświetlenie $(this).removeClass('highlight'); tabela1.eq($(this).index()).removeClass('highlight'); } );