_Eldar_,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<table>
<tbody>
<tr>
<td>описание</td>
<td>способ</td>
<td>дальше</td>
</tr>
<tr >
<td >sdfasdfываыв sdfsdfsdfsdfsdfsd</td> <td >500 s<br>
яндекс</td>
<td >650</td>
</tr>
<tr >
<td >dfasdfsdfsdfsdfs dfsdваываываываыва ываываыв sdfsdfsdfsdfsdfsd</td> <td id=s_stroka_$id> s<br>
</td>
<td > </td>
</tr>
<tr >
<td >dfasdfssdfsdf ываываываыв ыва ваываываываываыва ываываыв sdfsdfsdfsdfsdfsd</td> <td id=s_stroka_$id> s<br>
</td>
<td > </td>
</tr>
<tr >
<td >dfasdfsdfsdfsdfs dfsdваыв sdfsdfsdfsdfsdfsd</td> <td id=s_stroka_$id>-75 s<br>
яндекс</td>
<td >150</td>
</tr>
<tr >
<td >dfasdfsdfsdfsdfs dfsdsdfsdfsd</td> <td id=s_stroka_$id> s<br>
</td>
<td > </td>
</tr>
<tr >
<td >dfasdfsdfsdfsdfs dfsdываваыв sdfsdfsdfsdfsdfsd</td> <td id=s_stroka_$id >-50 s<br>
киви</td>
<td >150</td>
</tr>
<tr >
<td >делайте по минимуму, ничего привет </td>
<td id=s_stroka_$id> s<br>
</td>
<td > </td>
</tr>
<tr >
<td >dfasdfsdfsdfsdfs dfsdывыв sdfsdfsdfsdfsdfsd</td> <td id=s_stroka_$id>50 s<br>
киви</td>
<td >100</td>
</tr>
</tbody>
</table>
<script>
var td = document.querySelectorAll('table tr:nth-child(n+2) td:nth-child(2)') ;
function sum(previousSum, currentItem) {
var num = parseFloat(currentItem.innerHTML)||0
var result = previousSum + num;
currentItem.innerHTML = num + ' <span>' + result + '</span><br>'+ currentItem.innerHTML.split('<br>')[1]; result < 0 && currentItem.classList.add('red');
return result;
}
Array.prototype.reduceRight.call(td,sum,0)
</script>
<style type="text/css">
td:nth-child(2) span {
display: block;
float: right;
color: #006400;
background-color: #FFFACD;
font-size: 90%;
padding: 2px;
}
td.red span {
color: #FF3333;
}
</style>
</body>
</html>