标签:
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