Hello, im trying to get the text to move right next to the image but it wont work.. this is the page im talking about http://www.motorbikecentral.com/Interviews/Interviews.php this is the code im using <?php require('connect.php'); $result = mysql_query("SELECT * FROM articles WHERE category_id='7' ORDER BY article_id DESC ") or die(mysql_error()); echo "<table width='100%' cellspacing='0'>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; // image echo '<img name="myimage" src=' . $row['image'] . ' width="120" height="80" />'; // article name echo "</td><td style='vertical-align:top'>"; echo '<p><a style="font-size: 16px" href="'. $row['url'] .'">'. $row['article_name'] .'</a>'; echo "<br />"; // author + date echo "<small>"; echo "<b>AUTHOR : </b>"; echo $row['author']; echo" <img src='menuvertline.gif' style='vertical-align:center' width='2' height='10'> "; echo "<b>DATE POSTED: </b>"; echo $row['posted']; echo "<br />"; echo "</small><br /><br />"; echo "</td></tr>"; } ?> PHP:
I really don't understand what you need? You can tell us more clearly? But I think you change structure table to div, it will be better for your loop.
I have viewed your code and you can try this <?php require('connect.php'); $result = mysql_query("SELECT * FROM articles WHERE category_id='7' ORDER BY article_id DESC ") or die(mysql_error()); echo "<table width='100%' cellspacing='0' cellpadding='5'>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td width='130'>"; // image echo '<img name="myimage" src=' . $row['image'] . ' width="120" height="80" />'; // article name echo "</td><td style='vertical-align:top;text-align:left;' width='99%'>"; echo '<p><a style="font-size: 16px" href="'. $row['url'] .'">'. $row['article_name'] .'</a>'; echo "<br />"; // author + date echo "<small>"; echo "<b>AUTHOR : </b>"; echo $row['author']; echo" <img src='menuvertline.gif' style='vertical-align:center' width='2' height='10'> "; echo "<b>DATE POSTED: </b>"; echo $row['posted']; echo "<br />"; echo "</small><br /><br />"; echo "</td></tr>"; } ?> PHP:
Been a while since I have seen someone laying out a page with TABLES... CSS would make your life a lot easier plus produce cleaner code.
ive only been coding for about 2 years, and sorta just learnt html then css. i think i would take so long to change it all now
I started back in the 90's where every web page has a series of nested tables with in nested tables with in nested tables etc. When CSS support started to become more common I *figured* it would take too much of my time to learn CSS so I continued to ignore learning it. Finally one rainy day I decided to play around with it. With in a couple hours I was able to do most things people use CSS for to layout a page. Ever since then my development time has been greatly decreased and my HTML code is much smaller and no longer a headach to update. With CSS you can create changes to your entire layout by touching one file as appose to using tables which must be on every page. I absolutely suggest taking an afternoon to learn basic CSS. It will make your life easier and you will look back at using tables and say "geesh...I can't believe I use to waste my time designing table layouts"
Using CSS requires less HTML code and more control over the design. With CSS you can change an entire layout on a website without editing each page. With that said alone I highly recommend learning CSS. In fact, using CSS is the standard for designing today. I would redo your website if you plan on updating it. It sounds to me that you are still creating it. How many pages is it?