[jQuery] Re: Select all last cells of all rows?

2009-04-09 Thread ryan.j

could you not just do $('tr td:last').click()?

On Apr 9, 2:56 pm, MorningZ morni...@gmail.com wrote:
 I swear I've seen a post asking this before, one that I even
 participated in, but damned if i can find it

 given this table structure

 table
    thead
       tr
           thOne/th
           thTwo/th
           thThree/th
       /tr
     /thead
    tbody
       tr
           tdR1C1 Data/td
           tdR1C2 Data/td
           tdR1C3 Data/td ***
       /tr
       tr
           tdR2C1 Data/td
           tdR2C2 Data/td
           tdR2C3 Data/td ***
       /tr
       tr
           tdR3C1 Data/td
           tdR3C2 Data/td
           tdR3C3 Data/td ***
       /tr
     /tbody
 /table

 How can i select all the last cells that I denoted by *** ??

 I am currently doing:

 $(table tbody tr).each(function() {
       $(this).find(td:last).click(... my event here );

 });

 but is that doable without the .each ?


[jQuery] Re: Select all last cells of all rows?

2009-04-09 Thread ryan.j

aah, to do it that way you'd need to assign each row an id and include
a selector for each wouldn't you.

On Apr 9, 2:56 pm, MorningZ morni...@gmail.com wrote:
 I swear I've seen a post asking this before, one that I even
 participated in, but damned if i can find it

 given this table structure

 table
    thead
       tr
           thOne/th
           thTwo/th
           thThree/th
       /tr
     /thead
    tbody
       tr
           tdR1C1 Data/td
           tdR1C2 Data/td
           tdR1C3 Data/td ***
       /tr
       tr
           tdR2C1 Data/td
           tdR2C2 Data/td
           tdR2C3 Data/td ***
       /tr
       tr
           tdR3C1 Data/td
           tdR3C2 Data/td
           tdR3C3 Data/td ***
       /tr
     /tbody
 /table

 How can i select all the last cells that I denoted by *** ??

 I am currently doing:

 $(table tbody tr).each(function() {
       $(this).find(td:last).click(... my event here );

 });

 but is that doable without the .each ?


[jQuery] Re: Select all last cells of all rows?

2009-04-09 Thread ryan.j

$(tr td:last-child).click(function () {
alert(!);
});

On Apr 9, 3:01 pm, ryan.j ryan.joyce...@googlemail.com wrote:
 could you not just do $('tr td:last').click()?

 On Apr 9, 2:56 pm, MorningZ morni...@gmail.com wrote:

  I swear I've seen a post asking this before, one that I even
  participated in, but damned if i can find it

  given this table structure

  table
     thead
        tr
            thOne/th
            thTwo/th
            thThree/th
        /tr
      /thead
     tbody
        tr
            tdR1C1 Data/td
            tdR1C2 Data/td
            tdR1C3 Data/td ***
        /tr
        tr
            tdR2C1 Data/td
            tdR2C2 Data/td
            tdR2C3 Data/td ***
        /tr
        tr
            tdR3C1 Data/td
            tdR3C2 Data/td
            tdR3C3 Data/td ***
        /tr
      /tbody
  /table

  How can i select all the last cells that I denoted by *** ??

  I am currently doing:

  $(table tbody tr).each(function() {
        $(this).find(td:last).click(... my event here );

  });

  but is that doable without the .each ?


[jQuery] Re: Select all last cells of all rows?

2009-04-09 Thread ryan.j

aah, skip that - you'd need to give each row an id and broaden the
selector for that to work wouldn't you.

On Apr 9, 3:01 pm, ryan.j ryan.joyce...@googlemail.com wrote:
 could you not just do $('tr td:last').click()?

 On Apr 9, 2:56 pm, MorningZ morni...@gmail.com wrote:

  I swear I've seen a post asking this before, one that I even
  participated in, but damned if i can find it

  given this table structure

  table
     thead
        tr
            thOne/th
            thTwo/th
            thThree/th
        /tr
      /thead
     tbody
        tr
            tdR1C1 Data/td
            tdR1C2 Data/td
            tdR1C3 Data/td ***
        /tr
        tr
            tdR2C1 Data/td
            tdR2C2 Data/td
            tdR2C3 Data/td ***
        /tr
        tr
            tdR3C1 Data/td
            tdR3C2 Data/td
            tdR3C3 Data/td ***
        /tr
      /tbody
  /table

  How can i select all the last cells that I denoted by *** ??

  I am currently doing:

  $(table tbody tr).each(function() {
        $(this).find(td:last).click(... my event here );

  });

  but is that doable without the .each ?