I am trying to take the below pre-element HTML, and convert it to the below post-element HTML. If using thead and tfoot for the post element doesn't make sense, then tbody would work. I am thinking of starting with $('#myTable') and wrapping it with a div. I am struggling with how to best remove the header and footer, and insert them in their appropriate tables. Thanks for any suggestions.
Pre-element HTML:
<table id="myTable">
<thead>
<tr>
<th>H1</th>
<th>H2</th>
<th>H3</th>
</tr>
</thead>
<tfoot>
<tr>
<th>F1</th>
<th>F2</th>
<th>F3</th>
</tr>
</tfoot>
<tbody>
<tr>
<th>B1</th>
<th>B2</th>
<th>B3</th>
</tr>
</tbody>
</table>
Post element:
<div>
<table class="header">
<thead>
<tr>
<th>H1</th>
<th>H2</th>
<th>H3</th>
</tr>
</thead>
</table>
<div>
<table id="myTable" class="body">
<tbody>
<tr>
<th>B1</th>
<th>B2</th>
<th>B3</th>
</tr>
</tbody>
</table>
</div>
<table class="footer">
<tfoot>
<tr>
<th>F1</th>
<th>F2</th>
<th>F3</th>
</tr>
</tfoot>
</table>
</div>