Jquery | How to create/edit Jquery Datatable dynamically

| By Webner

How to create/edit Jquery Datatable dynamically?

HTML code:

<div class="col-md-12 col-sm-12 col-xs-12">
<table id="table">
<button id="go">Go</button>

Here is the javascript function:

function addData()
var data=[this array contains all the values that we need to show in table];
var dataTable = $('#table').DataTable();
  	 	var tBody = document.getElementById("tablebody");
  		var row = tBody.insertRow(i);
                row.id = "tablerow"+keys[i];
	        var cell = row.insertCell(0);
  cell.innerHTML = "+data[keys[i]]+""; } $('#table').DataTable(); }

Leave a Reply

Your email address will not be published. Required fields are marked *