JSFiddle - React, Tailwind, and code Playground
by seefeld
HTML
<table id="myTable">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Week 1</th>
<th scope="col">Week 2</th>
<th scope="col">Week 3</th>
<th scope="col">Week 4</th>
</tr>
</thead>
<tbody>
<tr>
<td scope="row">Some Data 1 </td>
<td>33.95%</td>
<td>11.99%</td>
<td>1.96%</td>
<td>0.00%</td>
</tr>
<tr>
<td scope="row">Some Data 1 </td>
<td>40.68%</td>
<td>16.66%</td>
<td>0.93%</td>
<td>1.21%</td>
</tr>
</tbody>
</table>
<div id="div"> </div>
CSS
body { padding: 20px;}
table { width: 350px;}
table th, table td {border: 1px solid #ddd; text-align: center;}
JavaScript
$(function() {
var tableData = $('#myTable tbody tr').map(function() {
var RowData = $(this).find('td:not(:first-child)').map(function() {
return $(this).html();
}).get();
return {
row: RowData,
test: "cokolwiek"
};
}).get();
console.log(tableData);
});