Thanks Karl - That suggestion works for applying an attribute to an entire column of a table, but I need to apply a custom selector which means looping over the rows. My selector is using a regex, and I need to compare a matched subexpression so if the regex is operating on unexepected values it bombs. Limiting it to one column would solve that problem.
Karl Swedberg-2 wrote: > > Dave Methvin answered this question back in October and then again in > February: > > http://www.nabble.com/Re%3A-highlight-table-column-on-hover- > p7074977.html > > Hope that helps. > > > --Karl > _________________ > Karl Swedberg > www.englishrules.com > www.learningjquery.com > > > > On Mar 12, 2007, at 3:40 PM, Daemach wrote: > >> >> So on the selector question, is there any jQuery selector that >> would enable >> me to limit the "search" to a single table column? >> >> >> Daemach wrote: >>> >>> In my ongoing quest to master jQuery I had an itch to write a table >>> filtering mechanism. I'm going for speed and elegance here so I >>> want this >>> to work fast enough to bind to a keyup event without bogging down >>> even on >>> long tables. Using DOM coding if I wanted to search the 3rd >>> column only I >>> would loop over oTable.rows[i].cells[2] to find the values. jQuery's >>> selectors are pretty generalized, so I'm wondering if there is a >>> jQuery >>> selector that is equally efficient. >>> >>> $("td:nth-child(3)", "#mytbody#") perhaps? Some kind of xpath >>> expression? >>> >>> If I had a text field in the table header row, what would be the >>> easiest >>> way to figure out what column it was in so I could pass that to the >>> selector? >>> >> >> -- >> View this message in context: http://www.nabble.com/Fastest- >> selector-for-searching-a-single-table-column--tf3382725.html#a9441789 >> Sent from the JQuery mailing list archive at Nabble.com. >> >> >> _______________________________________________ >> jQuery mailing list >> [email protected] >> http://jquery.com/discuss/ > > > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/Fastest-selector-for-searching-a-single-table-column--tf3382725.html#a9447729 Sent from the JQuery mailing list archive at Nabble.com. _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
