Home
Portfolio
Code Library
back to list
Move first row of a HTML table from tBody to tHead
1. Use prependTo() to insert the thead element 2. Use append() to insert the first tr inside the thead
JQuery
$('<thead></thead>').prependTo('#viewtable').append($('#viewtable tr:first'));
Written by AmmarCSE
https://stackoverflow.com/users/3474494/ammarcse
https://stackoverflow.com/questions/32889558/move-first-row-of-a-html-table-under-a-thead-tag-using-javascript
Posted by fbrefere001 on Tuesday June 18, 2019