JSFiddle - React, Tailwind, and code Playground
HTML
<table id="students" border="1">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>Grade</th>
</tr>
</thead>
<tbody>
<tr class="student">
<td>Oscar</td>
<td>23</td>
<td>16.5</td>
</tr>
<tr class="student">
<td>Antonio</td>
<td>32</td>
<td>14</td>
</tr>
<tr class="student">
<td>Jessica</td>
<td>21</td>
<td>19</td>
</tr>
</tbody>
</table>
JavaScript
var data = $('table#students tbody tr').map(function(index) {
var cols = $(this).find('td');
return {
id: index + 1,
name: cols[0].innerHTML,
age: (cols[1].innerHTML + '') * 1, // parse int
grade: (cols[2].innerHTML + '') * 1 // parse int
};
}).get();
console.log(data);