开发者

jQuery find 2nd Table add TD

I am missing something pretty simple here, I need to add a td in the 2nd table. I cannot get it and I know its something simple. I shortened it up for i开发者_如何学运维ntense and purposes:

<div id="content_area">
 <table>
    <table></table>
 </table>
 <table>
    <tr>
      <td> // I want to add another TD before this
        <table></table>
        <table></table>
      </td>  
    </tr>
 </table>
</div>


 $('#content_area').find('table:eq(1)').find('td').before('<td>Data</td>');


 $('#content_area').find('>table:eq(1)').find('td').before('<td>Data</td>');

If you don't use the ">" the second table will be the one into the first table.


 $('#content_area table:nth-child(2) tr').prepend('<td>Data</td>');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜