JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<thead>
<tr>
<td> Заголовок </td>
<td> Заголовок </td>
<td> Вес, кг </td>
<td> Цена, руб. с НДС </td>
</tr>
</thead>
<tbody>
<tr>
<td>Текст</td>
<td>Текст</td>
<td class="weight">1.35</td>
<td class="price"></td> </tr>
<tr>
<td>Текст</td>
<td>Текст</td>
<td class="weight">2.53</td>
<td class="price"></td> </tr>
</tbody>
</table>
CSS
table {
background: gray;
}
td {
padding: 1em;
background: white;
}
JavaScript
const price = 42.99
const NDS = 1.2
const rows = document.querySelectorAll('table tbody tr')
rows.forEach(row => {
const weightCell = row.querySelector('.weight')
const priceCell = row.querySelector('.price')
const weight = parseFloat(weightCell.textContent)
priceCell.textContent = weight * price * NDS;
});