On 8/3/07, Matt Penner <[EMAIL PROTECTED]> wrote:
> If I wanted the 2nd row 3rd cell the following works:
> $("tr:eq(1), td:eq(2)")
This will return the entire 2nd row and 3rd column.

On 8/3/07, Ganeshji Marwaha <[EMAIL PROTECTED]> wrote:
> I would use $("td:eq(2)", $("tr:eq(1)"))
This works, but is a clunky way of writing it.

Matt, using :eq is certainly the best idea.
Your example would be:
$("tr:eq(1) td:eq(2)")

If you wanted to iterate through the table you could do:
$("tr").each(function(i){
  $("td",this).each(function(j){
    $(this).html("Row: "+i+", Col: "+j);
  });
});

~Sean

Reply via email to