I would like to set the value of all the cells of a table by iterating through them.
Ideally I would like to access a Html table like an array i.e. $(\"#tbl\")[row][col]=\
You mean like this?
1 2
1 2
1 2
1 2
var tr = 1;
$('table tr').each(function(){
var td = 1;
$(this).find('td').each(function(){
$(this).append(' | TR : ' + tr + ' TD : ' + td );
td++;
});
tr++;
});
Live demo here : http://jsfiddle.net/8xFFH/
Iterates through all the TD's so you know which you're in. You can also just use $('table tr td').append()
if it's a static append.