UJKJDF,
нулевая ячейка для первого инпута, в сумме всего не учавствует, таблице дан класс.
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
window.addEventListener("DOMContentLoaded", function() {
function c() {
var d = a.reduce(function(b, a, i) {
return i ? b + a : 0
}, 0);
a.forEach(function(k, c) {
if(!c||!d) return;
var e = 100 * k / d,
h = a[0] * e / 100,
g = f[c].cells;
g[1].innerHTML = e.toFixed(2) + "%";
g[2].innerHTML = h.toFixed(2)
})
}
var f = document.querySelectorAll(".harvest tr"),
a = [];
[].forEach.call(f, function(d, b) {
a[b] = 0;
d.querySelector("input").addEventListener("input", function() {
a[b] = +this.value.replace(",", ".") || 0;
c()
})
})
});
</script>
</head>
<body>
<table width="400" class="harvest" >
<thead>
<tr>
<th>num</th>
<th>%</th>
<th><input type="text"></th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text"></td>
<td></td>
<td></td>
</tr>
<tr>
<td><input type="text"></td>
<td></td>
<td></td>
</tr>
<tr>
<td><input type="text"></td>
<td></td>
<td></td>
</tr>
<tr>
<td><input type="text"></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>