Making Nice Tables
Posted: Wed Sep 28, 2005 4:06 pm
Take a look at my code below:
I want to make all of the records print out in that HTML format.
Code: Select all
<?php
$img = "specials";
$alt = "Specials";
include("layout.php");
include("connect.php");
?>
<table align="center" width="375" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="img/middle2_top.gif"></td>
</tr>
<tr>
<td>
<table width="375" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="img/middle2_left.gif"><img src="img/middle2_left.gif"></td>
<td bgcolor="#FFFFFF" width="100%">
<table width="100%" border="0" cellpadding="5" cellspacing="1">
<tr>
<td align="center" colspan="2">
<font face="Verdana" size="2">
<h3>This Months Specials</h3>
Check back soon for next months specials!
</font>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<?php
$result = mysql_query("SELECT * FROM specials ORDER BY sortorder ASC");
while($row = mysql_fetch_array($result)) {
?>
<tr>
<td bgcolor="#E9E9E9" align="center">
<font face="Verdana" size="2"><b><?php echo $row["item"]; ?>:</b></font>
<br><br>
<a href="specials/<?php echo $row["file"]; ?>" target="_blank"><img src="thumbnail.php?dir=specials&file=<?php echo $row["file"]; ?>" alt="<?php echo $row["item"]; ?>" border="1"></a><br>
<font face="Verdana" size="1">(<a href="specials/<?php echo $row["file"]; ?>" target="_blank">Enlarge Photo</a>)</font>
<br><br>
<font face="Verdana" size="2" color="#FF0000"><b>Price:</b> $<?php echo $row["price"]; ?></font>
</td>
<td bgcolor="#E9E9E9" align="center">
<font face="Verdana" size="2"><b><?php echo $row["item"]; ?>:</b></font>
<br><br>
<a href="specials/<?php echo $row["file"]; ?>" target="_blank"><img src="thumbnail.php?dir=specials&file=<?php echo $row["file"]; ?>" alt="<?php echo $row["item"]; ?>" border="1"></a><br>
<font face="Verdana" size="1">(<a href="specials/<?php echo $row["file"]; ?>" target="_blank">Enlarge Photo</a>)</font>
<br><br>
<font face="Verdana" size="2" color="#FF0000"><b>Price:</b> $<?php echo $row["price"]; ?></font>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<?php
}
?>
</table>
</td>
<td background="img/middle2_right.gif"><img src="img/middle2_right.gif"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="img/middle2_bottom.gif"></td>
</tr>
</table>
<?php
footer();
?>