I have an HTML table which eg, 2 columns
and the data in the 1st one are like this: (the 2nd is empty -I use _ as "empty"-)
1 (5%) | _
2 (10%) | _
3 (15%) | _
which, for reference is:
<table id="my_table" >
<tbody>
<tr>
<td>1 (5%)</td>
<td></td>
</tr>
<tr>
<td>2 (10%)</td>
<td></td>
</tr>
<tr>
<td>3 (15%)</td>
<td></td>
</tr>
</tbody>
</table>
I want (in javascript -greasemonkey- ) for each cell of that column,
to move the number which is inside the parentheses (=with regex matching),
to the cell next to it, i.e. to the 2nd column.
Therefore the table will be converted to
1 | 5%
2 | 10%
3 | 15%
which is:
<table id="my_table" >
<tbody>
<tr>
<td>1</td>
<td>5%</td>
</tr>
<tr>
<td>2</td>
<td>10%</td>
</tr>
<tr>
<td>3</td>
<td>15%</td>
</tr>
</tbody>
</table>
How can this be achieved?