首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >导出Excel表格

导出Excel表格
EN

Stack Overflow用户
提问于 2017-09-15 01:33:02
回答 1查看 50关注 0票数 1

日安,

如何在excel中导出此表。我已经搜索了几个网站,但仍然没有成功,有人可以帮助我,在这里我留下了我正在使用的代码和生成表

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

发布于 2017-09-15 01:46:24

我建议您回顾一下PHPExcel库( https://github.com/PHPOffice/PHPExcel)。

你好,艾德。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46225196

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档