Min kode ser sådan her ud, hvis det kan bidrage med noget:
?php
header("Content-type: application/vnd.ms-excel");
?>
<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=utf-8" />
<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 width=100% style="border-collapse: collapse">
<tr>
<td class=xl2216681 nowrap><b>Navn1</b></td>
<td class=xl2216681 nowrap><b>Navn2</b></td>
<td class=xl2216681 nowrap><b>Adresse1</b></td>
<td class=xl2216681 nowrap><b>Postnr</b></td>
<td class=xl2216681 nowrap><b>Bynavn</b></td>
<td class=xl2216681 nowrap><b>Adresse2</b></td>
</tr>
<?php
$sql = "SELECT * FROM ".$kalendernavn."kunder WHERE tur_nr = '".$_GET['turnr']."' ORDER BY navn1 ";
$res = database($sql);
while($row = mysql_fetch_array($res)) {
print "<tr>
<td class=xl2216681 nowrap>".$row['navn1']."</td>
<td class=xl2216681 nowrap>".$row['navn2']."</td>
<td class=xl2216681 nowrap>".$row['adresse1']."</td>
<td class=xl2216681 nowrap>".$row['postnr']."</td>
<td class=xl2216681 nowrap>".$row['bynavn']."</td>
<td class=xl2216681 nowrap>".$row['adresse2']."</td>
</tr>";
}
print "
</table>
</div>
</body>
</html>";
?>