function update_subs(yesterday_string){ //yesterday_string -строка с датой $('#positions-table tbody tr').each(function(i) { var that = this; $(this).children("td:gt(4)").each(function(j){ var today_string = $('#positions-table th:eq('+(5+j)+')').html(); today = result["rows"][i][today_string];//получаем по i j yesterday = result["rows"][i][yesterday_string];//допустим у нас есть i, но как правильно найти столбец? if (today > "0" && today < "999" && yesterday > "0" && yesterday < "999"){ var today_int = parseInt(today,10); var yesterday_int = parseInt (yesterday,10); if (yesterday_int-today_int>0){ $(this).append("+"+(yesterday_int-today_int)+""); } if (yesterday_int-today_int<0){ $(this).append(""+(yesterday_int-today_int)+""); } if (yesterday_int-today_int==0){ $(this).append(""+(yesterday_int-today_int)+""); } } }); }); }