CSS
Hejsan. Har aldrig använt Css men måste få in detta:
@media print {
thead {display: table-header-group;}
}
så att det kommer en header på varje sida man skriver ut. Vart fasiken ska jag lägga in den på min sida?
Jag skriver helt enkelt ut allt som finns i databasen i en tabell.
Sidan ser ut såhär just nu:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html>
<head>
<title> Skriv ut </title>
</head>
<body bgcolor = #E6E6E6>
<?php
require("connect.php");
$extract = mysql_query("SELECT * FROM newpeople ORDER BY id ASC");
$numrows = mysql_num_rows($extract);
echo "<table BORDERCOLOR=#666666 style='empty-cells: show' border='1'>";
echo "<tr>";
echo "<th width='120' align='center'> <b> Namn </b> </th>";
echo "<th width='120' align='center'> <b> Efternamn </b> </th>";
echo "<th width='120' align='center'> <b> Adress </b> </th>";
echo "<th width='120' align='center'> <b> Stad & post nr </b> </th>";
echo "<th width='120' align='center'> <b> Hemtelefon </b> </th>";
echo "<th width='120' align='center'> <b> Mobiltelefon </b> </th>";
echo "<th width='120' align='center'> <b> Arbetstelefon </b> </th>";
echo "</tr>";
while ($row = mysql_fetch_assoc($extract))
{
$id = $row['id'];
$Namn = $row['Namn'];
$Efternamn = $row['Efternamn'];
$Adress = $row['Adress'];
$Stad_Post_Nr = $row['Stad_Post_Nr'];
$Hemtelefon = $row['Hemtelefon'];
$Mobiltelefon = $row['Mobiltelefon'];
$Arbetstelefon = $row['Arbetstelefon'];
if ($Namn=='') $Namn =' ';
if ($Efternamn=='') $Efternamn =' ';
if ($Adress=='') $Adress =' ';
if ($Stad_Post_Nr=='') $Stad_Post_Nr =' ';
if ($Hemtelefon=='') $Hemtelefon =' ';
if ($Mobiltelefon=='') $Mobiltelefon =' ';
if ($Arbetstelefon=='') $Arbetstelefon =' ';
echo "<tr>";
echo "<td align='left' width='120'> $Namn </td>";
echo "<td align='left' width='120'> $Efternamn </td>";
echo "<td align='left' width='120'> $Adress </td>";
echo "<td align='left' width='120'> $Stad_Post_Nr </td>";
echo "<td align='left' width='120'> $Hemtelefon </td>";
echo "<td align='left' width='120'> $Mobiltelefon </td>";
echo "<td align='left' width='120'> $Arbetstelefon </td>";
echo "</tr>";
}
echo "<tr>";
echo "<th width='120' align='center'> <b> Namn </b> </th>";
echo "<th width='120' align='center'> <b> Efternamn </b> </th>";
echo "<th width='120' align='center'> <b> Adress </b> </th>";
echo "<th width='120' align='center'> <b> Stad & post nr </b> </th>";
echo "<th width='120' align='center'> <b> Hemtelefon </b> </th>";
echo "<th width='120' align='center'> <b> Mobiltelefon </b> </th>";
echo "<th width='120' align='center'> <b> Arbetstelefon </b> </th>";
echo "</tr>";
echo "</table>";
?>
</center>
</body>
<html>