I have a standard table:
I want to use jQuery to reformat the table, more specifically I want to add a closing tr and open a new tr within the tbody for the first td..
I can target it ok with the below jquery and the html is inserted but in the wrong way..
$('</tr><tr>').insertAfter('.table thead tr td:first-child');
the new markup is in the wrong order ... any help would be appreciated.
<tr></tr> <--wrong!
I need it to be:
</tr><tr>
am I missing something?
<table>
<thead>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
</tbody>
</table>