【发布时间】:2011-04-24 22:35:04
【问题描述】:
我有一张我正在使用的桌子,就像这样:
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="tablecontent">
<tr class="tablerow">
<td>This is the td I want to add a class to.</td>
<td class="cell2">Stuff</td>
<td class="cell3">Stuff</td>
</tr>
<tr class="tablerow">
<td>This is the td I want to add a class to.</td>
<td class="cell2">Stuff</td>
<td class="cell3">Stuff</td>
</tr>
</table>
每行中的第一个 TD 标记没有可使用的类或 ID。我无权更改 HTML 输出,所以我想添加一些 jQuery 来定位每个 tablerow 的第一个 TD 标记。我该怎么做?
【问题讨论】:
标签: jquery html css class html-table