PHP 从数据库打印 table,页脚在页面中间结束

PHP prints table from Database, footer ends up in the middle of the page

我让这个页面打印出 table 辆汽车。它打印了大约 13 辆带有图片的长 table 汽车。每页都有一个页脚,它工作正常,但在打印所有汽车的页面上(最长),它在中间的某个地方结束。谁能帮我解决这个问题?

<!DOCTYPE html>
<html>

<head>

  <meta charset="UTF-8">

  <title>Home</title>

    <link rel="stylesheet" href="css/style.css">

</head>

<body>
<center><div id="squareUnderLogo"><img src="images/logo.png" alt="Logo";></div></center>
<div id="logOutBtn" align="right"><a href="logout.php"><input type="submit" value="Log out" /> </a></div>

<?php
$servername = "localhost";
$username = "root";
$password = "usbw";
$dbname = "cars";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT id, plate, car, foto FROM cars";

$result = $conn->query($sql);



if ($result->num_rows > 0) {

    echo "<center><br><br><br><br><br><table border='1px solid black'></center>";


    while($row = $result->fetch_assoc()) {
        echo "<tr>";
        echo "<td width='338'>" . $row['foto'] . "</td>";
        echo "<td> <b>Naam:</b> " . $row['car'] . "&nbsp;&nbsp;<br><b>License plate:</b> " . $row['plate'] . "<br><b>Dealer:</b> " . "<br><b>Employee:</b> " . "<br><b>Workplace number:</b> " . "<br><b><i><a href='maintence.php' style='color: #000000'>Maintence>></a><i></b>" . "</td>";
        echo "</tr>";
    }

    echo "</table>";

} else {
    echo "No results.";
}

$conn->close();
?>
<footer><hr><div align="right">Car DB&nbsp;<br><i>&copy;Designed by Firstname Lastname 2016</i>&nbsp;</div> </footer>
</body>
</html>

CSS 对于页脚:

footer {
    font-family: 'Arial';
    font-size: 90%;
    width:100%;
    height:100px;
    position:absolute;
    bottom:0;
    left:0;

}

这对我有用:

将此添加到同一 php 页面。

 <style>
    footer {
        font-family: 'Arial';
        font-size: 90%;
        width:100%;
        height:100px;
        position:absolute;
        left:0;
    }   
</style>