i'm pretty new with react and web dev in general.
I've written down this code but it doesn't work like I intended (classic)
return (
<div>
<table className="table table-stripped">
<thead>
<tr>
<th>Name</th>
<th>Profit in KRW</th>
<th>Profit %</th>
</tr>
</thead>
<tbody>
{Object.entries(data).forEach(([key, value]) => {
return (
<tr>
<td>{key}</td>
<td>{value['profit_krw']}</td>
<td>{value['profit_perc']}</td>
</tr>
);
})}
</tbody>
</table>
</div>
)
Here data
looks like {'ada':{'profit_krw': '5000', 'profit_perc': '0.2'}, 'btc': {'profit_krw': '10000', 'profit_perc': '0.4'}}
So in the end I would like it to look like ideally,
Name Profit in KRW Profit%
ada 5000 0.2
btc 10000 0.4