如何正确使用DATATABLE

            <table id="tbl" class = "table table-striped table-bordered" style="border-top:0px;">
      <thead>
        <tr>
          <th></th>
          <th><p style="text-align:center;">Answered</p></th>
          <th><p style="text-align:center;">Post</p></th>
          <th><p style="text-align:center;">Views</p></th>
        </tr>
      </thead>
      <tbody>
          <?php
          $res = $db->viewquestion();
            $ask_id= '';
          foreach ($res as $key => $value) {
              $ask_id = $value['iask_id'];

            ?> 

      <tr>
        <td>
          <div align="left" width="400">
            <?php echo '<a href="askpriest?iask_title='.$value['iask_title'].'">'?>
            <img src="./<?php echo $value['image']; ?>" style="border-radius:50%;float:left" width="20%" height="20%" class="pull-left"> 
            <h5><strong class="font-1-2" style="color:#59960b;border-radius:50%;float:left"><?php echo $value['iask_title']?></strong></h5>
            <br><p class="font-1-2" style="color:#000000;border-radius:50%;font-size:12px;float:left">by:<?php echo $value['firstname'].' '.$value['lastname'].' '. $value['date_send'].'<br> in '.$value['iask_topic'] ?> </p> 
             </a>
          </div>
        </td>
        <td>
          <?php
            if($value['iask_answered']==1){
          ?>
            <p align="center" style="padding-top:20px;"><span  class="fa fa-check" style="color:#59960b;"></span></p>
          <?php
            }else{
          ?> 
            <p align="center" style="padding-top:20px;font-size:30px;"><span style="color:#59960b;"></span></p>
          <?php
            }
          ?>
        </td>
          <td>
            <p class="font-1-5" style="padding-top:25px;text-align:center;" width="80"><?php echo $value['iask_post']?></p>
          </td>
          <td> 
            <p class="font-1-5" style="padding-top:25px;text-align:center;"><?php echo $value['iask_view']?> </p>
          </td>
          </div>
       </tr>
          <?php 
            }
          ?>
      </tbody>
      </table>

so i have this table and im trying to use the datatable js..

 <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"/>
    <script type="text/javascript" src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src=" //code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript">
      $(document).ready(function() {
            $('#tbl').DataTable();
          });
</script>

but unfortunately nothing happens on the table.. i tried searching on web and they said that the and should be equal.. so i tried to count how many is the and and they are equal.. i dont have any idea how to fix this since the only answer i get was to and should be equal.. hel

Your table has the id equal with "tbl" so the code should be

 $(document).ready(function() {
           $('#tbl').DataTable();
   });

You can use jquery data-table like:

html:

<table id="data_table">
<thead>
    <tr>
        <th>Emp Code</th>
        <th>First Name</th>
        <th>Last Name</th>
        <th>Mobile</th>
    </tr>
</thead>

<tbody>
<!-- Dynamic Body -->
</tbody>
</table>

Jquery:

$(document).ready(function() {
    var data = [];
    data.push(
        [1,"Sasha","Brenna","0800 1111"],
        [2,"Sage","Mia","(01012) 405872"],
        [3,"Chelsea","Allistair","076 0578 0265"],
        [4,"Uta","Savannah","070 1247 5884"],
        [5,"Remedios","Berk","0995 181 0007"],
        [6,"Ruby","Wayne","0800 1111"],
        [7,"Faith","Fredericka","(01709) 099879"],
        [8,"Myra","Harrison","070 4241 9576"],
        [9,"Drake","Miriam","0800 733635"],
        [10,"Reed","Shannon","076 8597 5067"]
    );

    $('#data_table').DataTable( {
        data: data,
    });
});

Working Fiddle