I have a table with 6 fixed columns that looks like the below and variable content that is created dynamically. Within each column a value can only appear once but may not appear in all columns.
Is there a way I can get a list / array with all the values from the columns Cat and the volumes from columns Vol like the example variables below?
My table:
<table id="myTable">
<thead>
<tr>
<th class="myHeader">Cat 1</th>
<th>Vol 1</th>
<th class="myHeader">Cat 2</th>
<th>Vol 2</th>
<th class="myHeader">Cat 3</th>
<th>Vol 3</th>
//...
</tr>
</thead>
<tbody>
<tr>
<td>item1</td><td>8</td><td>item2</td><td>7</td><td>item3</td><td>9</td>
</tr>
<tr>
<td>item3</td><td>5</td><td>item2</td><td>7</td><td>item1</td><td>4</td>
</tr>
<tr>
<td>item2</td><td>1</td><td>item1</td><td>5</td><td>item3</td><td>3</td>
</tr>
//...
</tbody>
</table>
Required output:
var item1 = [8, 4, 5]
var item2 = [7, 7, 1]
var item3 = [9, 5, 3]
<td>?</body>should be</tbody>