JQuery更改下一个表属性

我试图在类.rewardpoints的字体标记后更改下一个表属性。每次我尝试以下代码时,它会将表格上的cellpadding更改为5.Owardpoints .rewardpoints。有任何想法吗?
<table cellspacing="0" cellpadding="0" border="0">
     <tbody><tr>
        <td>
        <font></font>
        <font></font>
        <font class="text colors_text rewardpoints"><span>Earn Burkett Bucks</span></font>
             <table width="100%" cellspacing="0" cellpadding="10" border="0">
               <tbody>
                 <tr>
                   <td>
                   </td>
                 </tr>
              </tbody>
             </table>
        </td>
    </tr></tbody>
</table>

jQuery('.rewardpoints').closest('table').attr('cellpadding', '5');
我也尝试过以下方法:
jQuery('.rewardpoints').next('table').attr('cellpadding', '5');
jQuery('.rewardpoints').nextAll('table').attr('cellpadding', '5');
jQuery('.rewardpoints').siblings('table').attr('cellpadding', '5');
    
已邀请:
最近的DOM树。   从当前元素开始   旅行了   DOM树直到找到匹配   提供的选择器 你应该使用兄弟姐妹,或者下一个,或者使用nextAll     
使用next而不是最接近。 http://api.jquery.com/next/     

要回复问题请先登录注册