Posts: 256
Location: Auckland, New Zealand
|
There's probably an easier way to do this but my method is to store all cells together, instead of a row by row basis, that way you can check them all through another loop (your checking for background-image interests me, how do you plan on doing that?).
Code:
var tr = document.getElementById('myTable').rows;
var td = new Array()
for(i = 0, n = tr.length; i < n; i++) {
for(j = 0, m = tr[i].cells.length; j < m; j++) {
td.push(tr[i].cells[j]);
}
}
Now all you would need to do is loop through the array, an example would be:
Code:
for(k = 0, p = td.length; k < p; k++) {
alert(td[k].innerHTML);
}
This should grab all cells, even those that are in different table sections (thead,tfoot,tbody).
Cheers,
MC
__________________
#------------------------------ signature---------------------------------------------------------------------------------#
Quote:
|
I am well recognised for what I don't do than what I do. Chores are just one of those things.
|
|