首页 > 其他 > 详细

Clone table header and set as the first element, and replace header's th with td

时间:2015-08-04 15:10:22      阅读:240      评论:0      收藏:0      [点我收藏+]

Clone table header and replace header‘s th with td

var tableHeaderRow = ‘#tableId tbody tr:nth-child(1)‘; // this is th.
var copy = $(tableHeaderRow).clone();
$(‘#tableViewHeader‘).prepend(copy); // add this row as the first element in parent container.

$(‘#tableViewHeader‘).find(‘th‘).wrapInner(‘<td />‘).contents().unwrap();
$(‘#tableViewHeader‘).find(‘tbody‘).contents().unwrap();

 

Clone table header and set as the first element, and replace header's th with td

原文:http://www.cnblogs.com/webglcn/p/4701736.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!