2015-07-02 7 views
7

Uso il plugin javascript dataTables.fixedHeader e riempio i dati con ajax. Ora ho il problema, che la larghezza di ogni colonna di dati è dinamicamente e l'intestazione rimane sulla stessa larghezza statica.JS dataTables.fixedHeader larghezza diversa tra intestazione e dati

Different width

Codice:

HTML:

<table class="table table-striped table-bordered table-hover" id="custTable"> 
        <thead> 
         <tr> 
          <th> 
           ...... 
          </th> 
          <th> 
           ...... 
          </th> 
          <th> 
           ...... 
          </th> 
...... 
         </tr> 
        </thead> 
        <tbody id="dataList"></tbody> 
       </table> 

JS:

table = $('#custTable').DataTable({ 
      "dom": "frtiS", 
      "deferRender": true, 
     }); 

riempirlo:

$('#custTable').dataTable().fnAddData([ 
       xyz, xyz, xyz, ... 
         ]); 
+0

può fornire più di codice –

risposta

Problemi correlati