I have the following html structure (which is generated and I can't change):
<table id='tableID'>
<tbody>
<tr>
<td>
<table>...</table>
</td>
<td>
<table>...</table>
</td>
<td>
<table>...</table>
</td>
</tr>
<tr>
<td>
<table>...</table>
</td>
<td>
<table>...</table>
</td>
<td>
<table>...</table>
</td>
</tr>
....
</tbody>
</table>
What i am trying to do is to get all the outer rows and for each column in the outer row manipulate the content. So I've got something like:
var rows = $("#tableID > tbody > tr");
$.each(rows, function(n, row)
{
var columns = row.children("td");
if (columns.length > 0) {
$.each(columns, function (i, column)
{
//do stuff
});
}
});
The problem I'm having is that the when I get the child tds, it's too greedy and grabs tds from the nested tables too. Does anyone know how I can restrict this so that I only get the tds from the current row of the outer table? Or is there a better way of doing this?