I\'m trying to use the code below to dynamically add closing tag followed by opening so that i creates a new row every three cells. Almost working, DOM inspector shows a T
Another approach is to detach all the td elements, and then split them into groups of 3 using splice:
var td = $('tr td').detach();
$('tr').remove();
while(td.length>0){
$(td.splice(0,3)).wrapAll(' ').parent().appendTo('tbody');
}
example: http://jsfiddle.net/niklasvh/C6unV/