1
我需要分配一个样式到类“tableClass”的表。我有以下标记。最快的方式去jQuery的父母
<table border="0" cellpadding="0" cellspacing="0" class="tableClass">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" class="tableClass"> <-- Need to add a style here
<tr class="colheadrowclass">
.. some markup here
</tr>
more markup
<tr id="dataRow" class="datarowclass">
</tr>
</table>
</td>
</tr>
</table>
从datarowclass
,我需要遍历到第一台带班tableClass
并添加一个风格吧。
这对我有用,但我想知道是否有更快的方法。
$(".datarowclass").parents("table").eq(0).css("hieght", "500px");