[jQuery] Re: Select all last cells of all rows?
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" wrote: > could you not just do $('tr td:last').click()? > > On Apr 9, 2:56 pm, MorningZ 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 > > > > > > > > > One > > Two > > Three > > > > > > > > > > R1C1 Data > > R1C2 Data > > R1C3 Data *** > > > > > > R2C1 Data > > R2C2 Data > > R2C3 Data *** > > > > > > R3C1 Data > > R3C2 Data > > R3C3 Data *** > > > > > > > > > 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?
$("tr td:last-child").click(function () { alert("!"); }); On Apr 9, 3:01 pm, "ryan.j" wrote: > could you not just do $('tr td:last').click()? > > On Apr 9, 2:56 pm, MorningZ 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 > > > > > > > > > One > > Two > > Three > > > > > > > > > > R1C1 Data > > R1C2 Data > > R1C3 Data *** > > > > > > R2C1 Data > > R2C2 Data > > R2C3 Data *** > > > > > > R3C1 Data > > R3C2 Data > > R3C3 Data *** > > > > > > > > > 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?
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 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 > > > > > One > Two > Three > > > > > R1C1 Data > R1C2 Data > R1C3 Data *** > > > R2C1 Data > R2C2 Data > R2C3 Data *** > > > R3C1 Data > R3C2 Data > R3C3 Data *** > > > > > 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?
could you not just do $('tr td:last').click()? On Apr 9, 2:56 pm, MorningZ 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 > > > > > One > Two > Three > > > > > R1C1 Data > R1C2 Data > R1C3 Data *** > > > R2C1 Data > R2C2 Data > R2C3 Data *** > > > R3C1 Data > R3C2 Data > R3C3 Data *** > > > > > 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" ?