2017-09-14 75 views
1

美好的一天,導出Excel表格

如何在Excel中導出此表格。 我已經搜查幾個網,但我仍然沒有成功,有人可以幫助我,在這裏我離開,我使用並生成表

下面的代碼
<table id="tbAplicaciones" align="center"> 
    <thead> 
     <tr > 
       <th width="10%" scope="col">id_solicita</th> 
       <th width="10%" scope="col">Nombre</th> 
       <th width="10%" scope="col">Destino</th> 
       <th width="10%" scope="col">Folio</th> 
       <th width="10%" scope="col">Fecha Pago</th> 
       <th width="10%" scope="col">Cantidad Solicitada</th> 
       <th width="10%" scope="col">Tipo de Gasto</th> 
       <th width="10%" scope="col">Importe de Gasto</th> 

      </tr> 
    </thead> 
    <tfoot> 
     <?php 
         $id=0; 
         while ($clientes = pg_fetch_object($Cat)) 
         { 

          if ($numfila == 0){ $class = "alt"; $numfila = 1; } else { $class = ""; $numfila = 0; } 
           echo "<tr class'".$class."' style=\"height: 5px;\">"; 
           echo "<td align='center'>".$clientes->id_solicita."</td>"; 
            echo "<td>".utf8_decode($clientes->nombre)."</td>"; 
            echo "<td align='center'>".$clientes->destino."</td>"; 
            echo "<td align='center'>".$clientes->folio_gasto."</td>"; 
            echo "<td align='center'>".$clientes->fechapago."</td>"; 
            echo "<td align='center'>".$clientes->importe."</td>"; 
            echo "<td align='center'>".$clientes->tipogasto."</td>"; 
            echo "<td align='center'>".$clientes->importegasto."</td>"; 

           echo "</tr>"; 
           $id=$id+1; 
         } 
         if($id == 0) 
          // echo "Sin Sollicitudes Para Mostrar"; 
         echo $usr2; 
         pg_close(); 
      ?> 
    </tfoot> 
    <tfoot> 
</table> 
</div> </body> </html> <?php 
function ceros($numero, $ceros=2) 
    { 
    return sprintf("%0".$ceros."s", $numero); 
    }?> 
<script type="text/javascript" src="jquery-1.3.2.min.js"></script> 
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 
<script src="src/jquery.table2excel.js"></script> 
+0

[勾選此項](https://datatables.net/extensions/buttons/examples/initialisation/export) –

回答