header('Content-Type: text/html; charset=iso-8859-1');
session_start();
require_once ('librerias/cnn_bd.php');
$db = new db;
$sql = "select * from ...";
$regAux = mysqli_query($db->cnn, $sql);
header('Pragma: ');
header('Cache-Control: ');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename=excel_lsg.xls');
?>
<style type="text/css">
* {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
table {border-collapse: collapse;}
.datos {border: 1px solid #000000}
.cabecera {
background-color: #F9D119;
color: #000000;
text-align: left;
font-weight:bold;
}
</style>
<table cellpadding="3" cellspacing="0" class="datos" border="1">
<tr>
<th class="cabecera">xxx</th>
<th class="cabecera">xxx</th>
<th class="cabecera">xxx</th>
</tr>
<?php
while ($rowAux = $regAux->fetch_assoc()) { ?>
<tr>
<td class="datos"> <?=$rowPS["..."];?></td>
<td class="datos"> <?=$rowPS["..."];?> </td>
<td class="datos"> <?=$rowPS[".."];?> </td>
</tr>
<?php
}
?>
</table>
Crear Excel de forma básica
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario