PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
imsoconfused
Forum Newbie
Posts: 15 Joined: Mon Oct 05, 2009 10:55 pm
Post
by imsoconfused » Tue Oct 06, 2009 8:25 pm
Why isin't the html table rendering? I know I could just close the php tag and put the html after but i am working on something more complex that deals with this concept.
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
echo "<table border="1">";
echo "<tr>";
echo "<td>row 1, cell 1</td>";
echo "<td>row 1, cell 2</td>";
echo "</tr>";
echo "<tr>";
echo "<td>row 2, cell 1</td>";
echo "<td>row 2, cell 2</td>";
echo "</tr>";
echo "</table>";
?>
</body>
</html>
veldthui
Forum Newbie
Posts: 10 Joined: Tue Oct 14, 2008 4:10 pm
Post
by veldthui » Tue Oct 06, 2009 8:41 pm
Have not checked this but would assume it is because of
echo "<table border="1">";
May be you should use
echo '<table border="1">';
or escape the " around the 1
imsoconfused
Forum Newbie
Posts: 15 Joined: Mon Oct 05, 2009 10:55 pm
Post
by imsoconfused » Tue Oct 06, 2009 8:56 pm
Awesome thanks,
Changing double quote to single quote is the answer