<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<table width="400" summary="" >
<tbody>
<tr>
<td>Cell 1.1</td>
<td>Cell 1.2</td>
<td>Cell 1.3</td>
</tr>
<tr>
<td>Cell 2.1</td>
<td>Cell 2.2</td>
<td>Cell 2.3</td>
</tr>
</tbody>
</table>
<script>
[].forEach.call(document.querySelectorAll('tr'), function(item,i) {
var td = item.insertCell(item.cells.length);
td.innerHTML = i
});
</script>
</body>
</html>