title: How to make table from AJAX success a dataTable()
body: <p>I have a library of dataTable() in some parts of my prototype website but without ajax function <strong>Without ajax</strong></p>
  
  <pre><code>&lt;table id = 'mytable'&gt;
     //some content   
  &lt;/table&gt;
  </code></pre>
  
  <p>making table a datatable <code>$('#mytable').dataTable();</code> this method works and made the table a datatable</p>
  
  <p>Here's how i applied it on using ajax</p>
  
  <pre><code>$.ajax({  
        url:"user.php",  
        method:"POST",  
        data:{id,id},  
        success:function(data) {  
             $(data).find('#usertable').dataTable();
              $('#myDiv').html(data);
            }
  });
  </code></pre>
  
  <p><strong>sample.php</strong></p>
  
  <pre><code>$output .= '  
         &lt;table id = "usertable"&gt;
                //some content
         &lt;/table&gt;';
  
  echo $output;
  </code></pre>
  
  <p>how can i make the ajax success response a datatable?</p>