If what you're wanting to do is move the empty "cells" as you say and not "rows" this works...
$(document).ready(function(){
$("td").each(function(){
if ($(this).text().length == 0){
$(this).appendTo($(this).closest("tr"));
}
});
});
That should move all empty cells to the end of each row.
It may not be the fastest or most elegant but it appears to work.
However if what you're trying to do is move empty "rows" to the end of the table then this works...
$(document).ready(function(){
$("tr").each(function(){
var rowtext = "";
$(this).find("td").each(function(){
rowtext += $(this).text();
});
if (rowtext.length == 0){
$(this).appendTo($(this).closest("table"));
}
});
})
If these don't execute fast enough you can try speeding up this code by using a more specific selector in the first line under $(document).ready().