onthespot Posted August 15, 2009 Share Posted August 15, 2009 Hey guys, I have the following code. <table> <tr> <td> <b><u>Awards:</u></b> </td> </tr> <tr> <td> <?php function awards($type) { $images = array ( 'league1' => 'first.jpg', 'league2' => 'second.jpg', 'league3' => 'third.jpg' ); if(array_key_exists($type, $images)) return '<img src="images/awards/'.$images[$type].'" width="12" height="27" />'; return false; } $awarduser = mysql_real_escape_string($req_user_info['username']); $res=mysql_query("SELECT * FROM ".TBL_AWARDS." WHERE awarduser = '$awarduser' ORDER BY awarddate"); while($row=mysql_fetch_assoc($res)){ $type=$row['awardtype']; echo awards($type); } ?> </td> </tr> </table> Each award shows down the page vertically, I want them to go across the page horizontally. Please help Quote Link to comment https://forums.phpfreaks.com/topic/170390-want-it-across-screeen/ Share on other sites More sharing options...
infiniteacuity Posted August 17, 2009 Share Posted August 17, 2009 Most people will say you need to use <div> tags. However, you can remove the <td> </td> tags that surround your php code and place them inside. Change: echo awards($type); to: echo "<td>" . awards($type) . "</td>"; Quote Link to comment https://forums.phpfreaks.com/topic/170390-want-it-across-screeen/#findComment-900235 Share on other sites More sharing options...
ignace Posted August 17, 2009 Share Posted August 17, 2009 can you please keep it to 1 topic? http://www.phpfreaks.com/forums/index.php/topic,265372.msg1251308.html http://www.phpfreaks.com/forums/index.php/topic,265228.msg1250794.html Quote Link to comment https://forums.phpfreaks.com/topic/170390-want-it-across-screeen/#findComment-900269 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.