jQuery选择器问题(表中每个TR中的第一个TD)

Ale*_*lex 7 jquery jquery-selectors

我正在尝试将css类添加到我表中每个tr(行)的第一个td(单元格)(并且没有其他td).

有人可以帮助我使用jQuery选择器吗?

谢谢!

kar*_*m79 10

使用第一个子选择器:

$("table tr td:first-child").text("I am the first child of the row");
Run Code Online (Sandbox Code Playgroud)

一点点测试:http://jsfiddle.net/WxzfQ/