Is there a reason why <tr>
and <td>
tags would work whilst inside a <pre>
tag?
I am using a <pre>
tag to show some PHP code on a website and within the code are various instances of the html tags <tr>
and <td>
, these are jumping out of the <pre>
tags and executing at the bottom. Why would they do this??
They are included after echo
and inside "" and '' and both are executing the same. I have no pre
in my CSS and can't find any similar problems on the net.
Example:
echo '<table border="1">';
echo "<tr><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td></tr>";
while($info = mysql_fetch_array($data)){
echo "<tr>";
echo "<td>" . $info['a'] . "</td>";
echo "<td>" . $info['b'] . "</td>";
echo "<td>" . $info['c'] . "</td>";
echo "<td>" . $info['d'] . "</td>";
echo "<td>" . $info['e'] . "</td>";
echo "</tr>";
};
echo "</table>";
I have tried using print
, no change