I have an HTML table having 10 rows and 10 columns each. If I click on 5th column of 5th row, then I need id and value of exact upper row i.e. 4th row and the exact upper column. I know that by prev() and by next() we can get id and value of previous and next columns. But I am wondering if there is any way to achieve this..
When I click on cell written 53 or 54 or 55 of 5th row then I want the value and id of previous row's column written 43 just because it is the upper column of all 53, 54 and 55 lower columns. Hope I have explained myself...
What I have done so far is
var TdID = $("#HFTdId").val();
var UpTdID = $("#" + TdID)
.closest('tr')
.prev()
.children('td')
.attr('id');
This piece of code gives me the 0th column of previous row.