Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/10/2015, 17:09
Avatar de Briss
Briss
 
Fecha de Ingreso: junio-2011
Mensajes: 1.293
Antigüedad: 12 años, 9 meses
Puntos: 12
Conservar formato al exportar a excel

Hola a todos estoy exportando un archivo a excel con el siguiente código
Código PHP:
<?php
header
("Pragma: ");
header('Cache-control: ');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0"false);
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename='ABC.xls'");

?>
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-type" content="text/html;charset=iso-8859-1" /> 
<style id="Classeur1_16681_Styles"></style> 
</head> 
<body> 
<div id="Classeur1_16681" align=center x:publishsource="Excel"> 
<table x:str border=0 cellpadding=0 cellspacing=0 style='border-collapse: collapse'> 
<tr> 
<td>Celda A1</td> 
<td>Celda B1</td> 
<td>Celda C1</td> 
</tr> 
<tr> 
<td>Celda A2</td> 
<td>Celda B2</td> 
<td>Celda C2</td> 
</tr> 
<tr> 
<td>Celda A3</td> 
<td>Celda B3</td> 
<td>Celda C3</td> 
</tr> 
</table> 
</div> 
</body> 
</html>

Funciona bien (al menos para lo que lo nececsito) pero tengo una duda que debo hacer para que al abrir mi excel la tabla salga centrada... o no es posible conservar el formato????
Mil gracias