title: Dynamic column header in datatable from json array
body: <p>I want to populate a Datatable with a dynamic column header and column data. I can populate dynamic column data successfully, but I can't achieve a dynamic column. I am using an array I get from a JSON AJAX request. My code is this:</p>
  
  <pre><code>&lt;body&gt;
      &lt;table id="example" class="display" cellspacing="0" width="100%" border="1"&gt;&lt;/table&gt;
  &lt;/body&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>var JSONResult = '{"column1":"data1","column2":"data2","column3":"data3","columnN":"dataN"}';
  var row_dtable = new Array();
  var dtable_api = $('#example').dataTable();
  
  $.each(JSONResult , function(key, value) {
      row_dtable.push(value);
  }); 
  dtable_api.api().row.add(row_dtable).draw(false);  
  </code></pre>
  
  <p>Thanks in advance.</p>