JSFiddle - React, Tailwind, and code Playground
HTML
<table width="652" border="0" cellpadding="5" cellspacing="0">
<thead>
<tr>
<th align="left"><strong>Product</strong>
</th>
<th align="left"><strong>Product Price</strong>
</th>
<th align="left"><strong>How much you want?</strong>
</th>
<th align="left"><strong>Total Price</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td width="210">Fruit:</td>
<td width="216">$ 10</td>
<td width="204">
<input type="text" />
</td>
<td width="204"></td>
</tr>
<tr>
<td>Drinks:</td>
<td>$ 22.95</td>
<td>
<input type="text" />
</td>
<td></td>
</tr>
<tr>
<td>Cards:</td>
<td>$ 5</td>
<td>
<input type="text"/>
</td>
<td></td>
</tr>
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td>Total price of all:</td>
<td id="total"></td>
</tr>
</tfoot>
</table>
JavaScript
$("input").on("keyup", function () {
var $input = $(this);
var howMany = parseInt($input.val());
var unitAmount = parseFloat($input.parent().prev().text().replace("$", ""));
var total = howMany ? howMany * unitAmount : 0;
$input.parent().next().text("€ " + total);
var total = 0;
$("tbody tr td:last-child").each(function() {
total += parseFloat($(this).text().replace("€","") || 0);
});
$("#total").html("€ " + total);
});