rdub Posted July 18, 2008 Share Posted July 18, 2008 I now use this code but it displays results in one long column. <?php // If you have selected from list box. if(isset($select)&&$select!="" && $select != "--select--" ){ // Get records from database (table "members"). $result=mysql_query("select * from members where Category_Listing='$select'"); echo "<h1>".$select."</h1><br>"; while($row=mysql_fetch_assoc($result)) { ?> </p> <table width="250" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><span class="style1"><strong> <?php echo $row['Customer']; ?></strong></span></td> </tr> <tr> <td align="left"><span class="style1"><? echo $row['Sub_Category']; ?></span></td> </tr> <tr> <td><span class="style1"><? echo $row['Phone']; ?></span></td> </tr> <tr> <td><span class="style1"> <?php if( $row['Fax'] != "") { echo "Fax " . $row['Fax']; } ?> </span></td> </tr> <tr> <td><span class="style1"><? echo $row['Description']; ?></span></td> </tr> <tr> <td><span class="style1"> <?php if( $row['Email'] != "" && $row['Email'] != "") { echo '<a href="mailto:'.$row['Email'].'">'.$row['Email']."</a>"; } ?> </span></td> </tr> <tr> <td><span class="style1"> <?php if( $row['Web_Link'] != "") { echo '<a href="'.$row['Web_Link'].'" target="_blank">'.$row['Web_Link']."</a>"; } ?> </span></td> </tr> </table> I would like to display in multiple columns to cut down on scrolling. code tags added : barand Quote Link to comment https://forums.phpfreaks.com/topic/115336-display-in-colmns/ Share on other sites More sharing options...
Barand Posted July 18, 2008 Share Posted July 18, 2008 1 ) this is PHP question (or CSS question depending on method used), not MySQL - moving tp PHP Help 2 ) use [ code ] tags around code Quote Link to comment https://forums.phpfreaks.com/topic/115336-display-in-colmns/#findComment-593168 Share on other sites More sharing options...
Daniel0 Posted July 18, 2008 Share Posted July 18, 2008 You picked the FAQ board when moving, Barand. I moved it to the correct one. Quote Link to comment https://forums.phpfreaks.com/topic/115336-display-in-colmns/#findComment-593185 Share on other sites More sharing options...
sardar.sy85 Posted July 31, 2008 Share Posted July 31, 2008 good! Quote Link to comment https://forums.phpfreaks.com/topic/115336-display-in-colmns/#findComment-604388 Share on other sites More sharing options...
ronnie88 Posted July 31, 2008 Share Posted July 31, 2008 get rid of the <tr> should stop going in a column Quote Link to comment https://forums.phpfreaks.com/topic/115336-display-in-colmns/#findComment-604397 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.