Assuming I have a table like below:

The table is generated using PHP. The update button should launch one of two interfaces depending on the Report type. The problem I have is getting each Update button to correspond to the Report type in its particular row only. I have tried this with the following code :
<table id="reportTbl" border="1" style="width:100%">
<tr>
<th>Report</th>
<th>Data</th>
<th>Update</th>
</tr>
<tr>
<td>Encrypted</td>
<td>Image</td>
<td><input type="submit" class="tbl_Update" value="Update" onclick="runPop();"></td>
</tr>
<tr>
<td>Unencrypted</td>
<td>Document</td>
<td><input type="submit" class="tbl_Update" value="Update" onclick="runPop();"></td>
</tr>
</table>
function runPop() {
var pop = new myPop();
var cells = document.getElementById('reportTbl').getElementsByTagName('td');
for (i = 0; i < cells.length;) {
var report = document.getElementById('reportTbl').getElementsByTagName('td')[i].innerHTML;
pop.popOut(report);
console.log(report);
i += 3;
}
}
myPopout() represents the class which handles the two interfaces it does this by checking the Report type.
The problem with the code above is when I click the button both interfaces are opened one on top of each other which must be due to the loop. How would I fix this?
data-*attribute)?