With a little help from my friend I managed to do it. I just had to set an "id" to each table and the rest did the code:
jQuery( "#idOfTheTable" ).on( "click", "tr", function() {
var el = jQuery(this);
if(el.find('th').length > 0 ) {
return false;
}
var apartNo = el.parent().find('tr').index(el);
var hotspotName = jQuery('.hotspots-image-container img').attr('usemap');
if(!apartNo || !hotspotName) {
return false;
}
jQuery(hotspotName + "-area-" + apartNo).trigger('click');
});
This is how it looks like:
http://apartamenty-sonata.pl/mieszkania/budynek-nr-1-pietro-iv
Hope this'll help someone.
Resolved. :)