PHP/Tables!!

A

Anonymous

Guest
right i have created my site, and i am under de-designing it, i have created this page :

http://punk-style.to-j.com/v2/news.php
but the images (links) are lower than the rest of the page, can annybody help!?

(code below)

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="75%">
  <tr>
    <td width="35%">&</td>
    <td width="65%"><? include("../includes/layout_top.inc.php"); ?></td>
  </tr>
  <tr>
    <td><a href="../index.php"><img src="../images/news-button2.png" width="180" height="49" border="0"></a><BR>
      <a href="../reviews.php"><img src="../images/reviews-button2.png" width="180" height="49" border="0"></a><BR><a href="../feat.php"><img src="../images/featured-button2.png" width="200" height="64" border="0"></a><BR><a href="../profiles.php"><img src="../images/profiles-button2.png" width="180" height="49"></a><BR><a href="mailto:sk8rstu@hotmail.com?Subject=Punk-Style"><img src="../images/contact-button2.png" width="200" height="64" border="0"></a><BR><a href="http://punk-style.to-j.com/forum/phpBB2/"><img src="../images/forums-button2.png" width="180" height="49"></a><BR>
      <a href="../links.php"><img src="../images/Links-button2.png" width="200" height="64" border="0"></a> </td>
    <td><? $session = session_id();

$c = mysql_connect(localhost,"punk_style_to_j_com","badger") or die ("<font color=\"#FF00FF\">sorry unable to connect to database".mysql_error()."</font>");

$db = mysql_select_db(punk_style_to_j_com,$c);

$query = "SELECT * FROM news ORDER BY `id` DESC";

$result = mysql_query($query) or die ("<font color=\"#FF00FF\">sorry unable to connect to database".mysql_error()."</font>");


echo("<font color=\"#FFFFFF\" face=\"Geneva, Arial, Helvetica, san-serif\"><b>The Goings on..</b></font>");

while ($row = mysql_fetch_array($result))
{
	echo("&nbsp");
	echo("<p align=\"center\">");
	echo("<table celpadding=\"1\" cellspacing=\"1\">");

		
			echo("<tr>");
			echo("<td align=\"center\" width=\"400\"><font color=\"#FFFFFF\">".$row["title"]."</font></td>");
		echo("</tr>");
		echo("<tr>");
		echo("<td align=\"center\" width=400 bgcolor=\"#FFFFFF\"><font color=\"#000000\">".$row["post"]."<br><i>Posted on".$row["date"]."</i></td>");
		echo("<tr><td width=\"400\">&</td></tr>");
		echo("</tr>");

		echo("</table>");
	echo("<p>");
} ?></td>
  </tr>
</table>
</body>
</html>
 
if you're making it in dreamweaver or something like that, just dump it in a a layer and drap it about...
 
php-punk said:
right i have created my site, and i am under de-designing it, i have created this page :

http://punk-style.to-j.com/v2/news.php
but the images (links) are lower than the rest of the page, can annybody help!?

The default for table cells in most browsers is to align cell contents to the vertical middle. To override this, in your <td> tag specify valign="top" to force the content to the top of the cell. Like so:

Code:
...
<td valign="top">
   <a href="../index.php"><img src="../images/news-button2.png" width="180" height="49" border="0"></a><BR> 
   <a href="../reviews.php"><img src="../images/reviews-button2.png" width="180" height="49" border="0"></a><BR>
   ...
</td>
...

I hope this helps. And for the record, what frogrocker suggests is generally a bad idea. Absolutely positioned layers don't degrade gracefully in older browsers.
 
frogrocker said:
if you're making it in dreamweaver or something like that, just dump it in a a layer and drap it about...

What a great slove of a problem, hehe, well it worked, but it doesn't realy solve a problem, just creates more for the future
 
Back
Top