/home/techb158/immovalet.ca/bower_components/datatables/examples/api
NameSizeModeActions
add_row.html108520666editdlrm
api_in_init.html208930666editdlrm
counter_column.html228850666editdlrm
editable.html228770666editdlrm
form.html251490666editdlrm
highlight.html206860666editdlrm
multi_filter.html228810666editdlrm
multi_filter_select.html258650666editdlrm
regex.html252410666editdlrm
row_details.html236040666editdlrm
select_row.html207770666editdlrm
select_single_row.html216360666editdlrm
show_hide.html210370666editdlrm
tabs_and_scrolling.html174510666editdlrm
Edit: /home/techb158/immovalet.ca/bower_components/datatables/examples/api/add_row.html (10852B)
DataTables example
DataTables add row example

Preamble

DataTables adding rows in DataTables is done by assigning the DataTables jQuery object to a variable when initialising it, and then using it's API methods to add a new row. Deleting rows can be done in a similar manner.

Live example

Click to add a new row

Column 1 Column 2 Column 3 Column 4
allan allan allan allan

Initialisation code

/* Global var for counter */
var giCount = 1;

$(document).ready(function() {
	$('#example').dataTable();
} );

function fnClickAddRow() {
	$('#example').dataTable().fnAddData( [
		giCount+".1",
		giCount+".2",
		giCount+".3",
		giCount+".4" ] );
	
	giCount++;
}

Other examples