JSFiddle - React, Tailwind, and code Playground
by ChrisStanyon
HTML
<table id="testTable" style="width:100%;">
<tr>
<td>Row 1 Col 1</td>
<td>Row 1 Col 2</td>
<td>Row 1 Col 3</td>
</tr>
<tr>
<td>Row 2 Col 1</td>
<td>Row 2 Col 2</td>
<td>Row 2 Col 3</td>
</tr>
<tr>
<td>Row 3 Col 1</td>
<td>Row 3 Col 2</td>
<td>Row 3 Col 3</td>
</tr>
</table>
JavaScript
function modTable(table) {
var firstRow = $('tr:first', table);
var restRows = $('tr:gt(0)', table);
var newTable = $('<table>').attr('id', table.attr('id'));
newRow = $('<tr>');
$('td', firstRow).each(function(i, td) {
newRow.append(td);
});
console.log(newRow);
};
$(document).ready(function () {
modTable( $('#testTable') );
});