JSFiddle - React, Tailwind, and code Playground
by Pasky Org
HTML
<table>
<caption></caption>
<thead>
<tr>
<th>#</th>
<th>PFs</th>
<th>RW</th>
<th>RWA</th>
<th>Nota</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
JavaScript
valorArca = 1.815;
function addPuja(id, a) {
rwa = Math.floor(a[1]*valorArca);
arcReq = ((a[0]/a[1]-1)*100).toFixed(2);
$('tbody')
.append(
$('<tr />')
.append($('<td />').text(id))
.append($('<td />').text(a[0]))
.append($('<td />').text(a[1]))
.append($('<td />').text(rwa))
.append($('<td />').text(arcReq))
)
}
pujas = [
[286,270],
[143,135],
[50,45],
[5,10],
[2,0]
]
pujas.forEach(function (puja,id) {
addPuja(id+1, puja);
});