I have a table as per the below and I want to use javascript or Jquery to get the value from the middle cell of each row. I then want to see the width of a div (id="myprogres") in the last cell to match the percentage that we just got.
My problems that I know of are
- my
tdtags don't have anidor anything unique to identify them by. So identifying the 3rdtdon each row isn't as simple asgetElementById - I want to get the value on each row, and then set the corresponding
myprogresswidth based upon that value. myprogressis not a uniqueid, it's the sameidper row.
This is a simplified version of the table so I appreciate the full css isn't there.
<table>
<tr>
<td>Hard drive</td>
<td>Usage</td>
<td>25</td>
<td>
<div style="width:100%">
<div id="myprogress"></div>
</div>
</td>
</tr>
<tr>
<td>Memory</td>
<td>Usage</td>
<td>50</td>
<td>
<div style="width:100%">
<div id="myprogress"></div>
</div>
</td>
</tr>
<tr>
<td>Brain Power</td>
<td>Usage</td>
<td>75</td>
<td>
<div style="width:100%">
<div id="myprogress"></div>
</div>
</td>
</tr>
</table>