开发者社区 问答 正文

jquery操作表格

<table id="myTable">
<tr>
<th></th>
<th id="num2">想移动的行</th>
<th></th>
...移动到这里
</tr>
 
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>

我想让 id="num2"的那一个

标签移动到指定位置,但下面一行的id我又是不知道的,我该怎么操作呢?各位大大帮帮我吧!

展开
收起
a123456678 2016-07-11 11:51:08 1940 分享 版权
1 条回答
写回答
取消 提交回答
  • var th_num2 = $('#num2'); 
    th_num2.next('th').after(th_num2.clone()); 
    th_num2.remove(); 
    2019-07-17 19:54:06
    赞同 展开评论
问答分类:
问答地址: