title: Uncaught TypeError: Cannot read property 'aDataSort' of undefined
body: <p>i am working on pagination and i am using <a href="https://www.datatables.net/">DataTables</a> plugin ,
  on some tables it's work but on some tables it gives error:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'aDataSort' of undefined</p>
  </blockquote>
  
  <p>my page script looks like:</p>
  
  <pre><code>$(document).ready(function() {
       $('.datatable').dataTable( {
          "scrollY":        "200px",
          "scrollCollapse": true,
          "info":           true,
          "paging":         true
      } );
  } );
  </code></pre>
  
  <p>//HTML code</p>
  
  <pre><code>&lt;table class="table table-striped table-bordered datatable"&gt;
     &lt;thead&gt;
          &lt;tr&gt;
            &lt;th&gt;&lt;?php echo lang('date_label')?&gt;&lt;/th&gt;
            &lt;th&gt;&lt;?php echo lang('paid_label')?&gt;&lt;/th&gt;
            &lt;th&gt;&lt;?php echo lang('comments_label');?&gt;&lt;/th&gt;
          &lt;/tr&gt;
     &lt;/thead&gt;
     &lt;tbody&gt;
        &lt;?php foreach ($payments as $pay): ?&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;?php echo dateformat($pay['time_stamp'], TRUE);?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo format_price($pay['amount']);?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $pay['note'];?&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;?php endforeach?&gt;
     &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>no idea how the problem comes ,i know this is very common error but i search and found nothing supporting my problem .<br>
  does anyone knows the solution ?</p>