I am teaching myself PHP and am having an issue with a table I just created. I have my code and what is being displayed below. I have been sitting here for hours trying to figure it out but can't. If any one can explain why the table doesn't complete the while loop and everything after the the closing of the last row displays above the table...hopefully I'm clear enough for everyone or at least someone to understand.
As pointed out, I should include the code for those who are using screen readers.
<html>
<head>
<link rel="stylesheet" type="text/css" href="freight.css">
<!--<script type="text/javascript" src=""></script>-->
<title>PHP Loops Example</title>
</head>
<body>
<h3>PHP generated</h3>
<table>
<tr>
<th>Distance</th>
<th>Cost</th>
</tr>
<?
$distance = 50;
while ($distance <= 250){
echo "<tr>
<td>.$distance.</td>
<td>.($distance/10).</td>
</tr>";
// displays everything from the double quote (above) to the end of the whilte loop
$distance += 50;
}
?>
</table>
<? echo "$distance"; ?> <!-- doesn't display -->
</body>
</html>