I have a problem with my excel download php script
This is my table that will be generated in excel .The following is my php code that generates the report in excel
<?php
require "../conexion.php";
if(($_GET['mes']=="") && ($_GET[$nombremes]==""))
{
$consulta="";
}else
{
$consulta="AND date_format(s.fecha,'%Y-%m') ='".$_GET['mes']."'";
}
$departamentos=mysql_query("select distinct d.id_departamento ,d.nombre from departamento as d , solicitud as s where status=1 and s.id_departamento=d.id_departamento and costo<>0");
while ($e=mysql_fetch_array($departamentos)){
$so ="SELECT s.Id_folio, s.fecha,d.id_departamento,g.Id_gerencia,g.Nombre_gerencia, d.nombre, s.Id_servicio,s.tipo_solicitud,sum(s.costo) as suma_costo,s.id_vehiculo, u.Empleado_Nombre, u.Empleado_id, t.Id_servicio, t.Nombre_servicio,v.id_vehiculo,nombre_vehiculo,s.Autoriza_Soli,s.Autoriza_Ger,s.Autoriza_GerIs,s.Autoriza_trab,s.Autoriza_termi,count(s.id_folio) as cantidad_solicitud FROM solicitud as s, departamento as d ,gerencias as g,usuarios as u, tipo_servicio as t,vehiculos as v WHERE s.id_departamento=d.id_departamento and s.Empleado_id =u.Empleado_id and s.Id_servicio =t.Id_servicio and d.id_gerencia=g.Id_gerencia and Estatus_gerencia=1 and status=1 and s.id_vehiculo=v.id_vehiculo and Autoriza_Soli=1 and Autoriza_Ger =2 and Autoriza_GerIs=3 and Autoriza_trab=4 and Autoriza_termi=5 ".$consulta." and d.id_departamento=".$e[0]."";
$mostrarso=mysql_query($so);
/*
<style>
table, tr, th, td{
border: 1px solid #000000;
text-align: center;
}
</style>
*/
$mos.="<table border-collapse: separate; border= 1px;>
<th scope='col' bgcolor='#008000'>Mes</th>
<th scope='col' bgcolor='#008000'>Departamento</th>
<th scope='col' bgcolor='#008000'>Área</th>
<th scope='col' bgcolor='#008000'>Cantidad de solicitud</th>
<th scope='col' bgcolor='#008000'> Suma de Costo</th>
";
while($i=mysql_fetch_array($mostrarso)){
date_default_timezone_set('America/Mexico_City');
setlocale(LC_TIME, 'es_ES.UTF-8');
setlocale(LC_TIME, 'spanish');
$nombremes=strftime("%B", strtotime($fecha_mes=$i[1]));
$fecha_mes=$i[1];
$partes = explode('-', $fecha_mes);
$_fecha = "{$partes[2]}-{$partes[1]}-{$partes[0]} ";
$mos .= "<td>". $nombremes."</td>";
$mos .="<td>".utf8_decode($i["nombre"])."</td>";
$mos .="<td>".utf8_decode($i["Nombre_gerencia"])."</td>";
$mos .= "<td>".utf8_decode($i["cantidad_solicitud"])."</td>";
$mos .= "<td>".$i["suma_costo"]."</td>";
}
}
$mos.="</table>";
header("content-type: application/octet-stream");
header("content-Dispositio:attachment; filename=Reporte.xls");
header("pragma: no-cache");
header("Expires: 0");
echo $mos;
?>
Here I have my report in php that generates this table in excel, but I get this way, when what is green is my excel header and I put it several times, do you help me correct this? href="https://i.stack.imgur.com/M192n.png">