I believe you have two options: $('tr>td')
or $('tr td:first-child') i've never used first-child myself so i may understand it wrongly.Let me know ! On Thu, Jan 8, 2009 at 10:58 PM, Tijmen Smit <tijmens...@gmail.com> wrote: > > I have a table that contains several <tr>, all of them look like > this. > > <tr> > <td>20-04</td> > <td>459</td> > <td>559</td> > <td>659</td> > <td>439</td> > <td>519</td> > <td>599</td> > <td>424</td> > <td>489</td> > <td>554</td> > </tr> > <tr> > <td>27-04</td> > <td>506</td> > <td>606</td> > <td>706</td> > <td>486</td> > <td>566</td> > <td>646</td> > <td>471</td> > <td>536</td> > <td>601</td> > </tr> > > > One of the things that I would like to do is add the class "date" to > the first td that exists after a <tr>. > > I came up with this -> $("#prijslijst-appartement tr td:eq > (0)").addClass("date"); , but that doesn't really do what I thought It > would. It only adds the date class to one td, and it ignores all the > other <tr> in the table. What I was hoping it would do is finding all > <tr>, and then add the date class to the first <td> in all the <tr> in > the entire table. > > You can see the example here -> http://tijmensmit.com/dev/td/prijslijst.html. > The one with the date class on it has the pink border around it. > > Its not only the first <td> which I should target, the 3th, 6th and > 9th <td> within each <tr> should also be given a different class. > > What would be the best way to do this, and to make sure it looks in > all <tr> in the entire table, and not stops after the first one? > > Thanks, > Tijmen