Is there a built-in method to do this?
And how to make table rows selectable and then delete a selected row?
Is there a built-in method to do this?
And how to make table rows selectable and then delete a selected row?
Just did it using this stackoverflow page:
$('.fw').append(
$('<tr/>').append( $('<td>').text('foo'))
)
Alternative shorthand way:
$('.fw').append( $('<tr><td>foo</td></tr>') );
Checkout http://docs.jquery.com/Manipulation for more.
$('#yourTableId').append('<tr><td>new row</td></tr>');
To delete clicked row do this:
$('tr').click(function () {
$(this).remove();
});
var row = $('<tr><td>...</td><td>...</td></tr>');
var lastRow = $('table tr:last');
row.insertAfter(lastRow);