2015-10-26 92 views
2

我已經在其上supossed來響應,但其not.Here是我的HTML引導的主題實現的一個jQuery的DataTable ..jQuery的數據表不成爲響應

<div class="col-xs-12 table-responsive"> 
      <table class="table table-condensed table-striped table-bordered" id="bttable"> 
       <tfoot> 
        <tr></tr> 
       </tfoot> 
      </table> 
     </div> 

這裏是我的jQuery ..

dt = $("#bttable").dataTable({ 
      "data": dataSet, 
      "paging": false, 
      "responsive": true, 
      "stateSave": true, 
      "columns": [ 
       { "title": "<input type='checkbox' id='selectAll'>", "bSortable": false, "width": "5px", }, 
       { "title": "<a href='#' class='btn btn-xs' title='Edit' data-toggle='modal' data-target='#responsive' onclick='edit()'><i class='fa fa-pencil'></i></a>", "bSortable": false, "width": "5px" }, 
       { "title": "FirstName", "width": "50px" }, 
       { "title": "LastName" }, 
       { "title": "Contact Number" }, 
       { "title": "Email ID" } 
      ] 
     }); 

我的小提琴:https://jsfiddle.net/56n6wwd8/

請幫助我,使這個數據表responsive..Thanks ..

+2

你的代碼工作正常,看https://jsfiddle.net/56n6wwd8/3/。不要忘記包含響應式擴展,請參見[Download Builder](http://datatables.net/download/index)。 –

回答

3

嘗試這樣的:

<div class="col-xs-12"> 
<div class="table-responsive"> 
     <table class="table table-condensed table-striped table-bordered" id="bttable"> 
      <tfoot> 
       <tr></tr> 
      </tfoot> 
     </table> 
    </div> 
</div> 
+0

我試了你的答案,但它仍然是..沒有幫助.. – Lara

+0

你呢?對這個問題有什麼幫助? – Lara

+0

把你的代碼在JSFIDDLE ... – Nere