Skip to content

Instantly share code, notes, and snippets.

@sebgod
Created May 5, 2014 06:30
Show Gist options
  • Save sebgod/775949e3ba95b31b9de9 to your computer and use it in GitHub Desktop.
Save sebgod/775949e3ba95b31b9de9 to your computer and use it in GitHub Desktop.
function addTableRow(jQtable){
jQtable.each(function(){
var $table = $(this);
// Number of td's in the last table row
var n = $('tr:last td', this).length;
var tds = '<tr>';
for(var i = 0; i < n; i++){
tds += '<td>&nbsp;</td>';
}
tds += '</tr>';
if($('tbody', this).length > 0){
$('tbody', this).append(tds);
}else {
$(this).append(tds);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment