Jump to content

Displaying results horizontally instead of vertically.


blade_922

Recommended Posts

Firstly the PHP Code

[code]


<table class='tablefull' >

<?php

$hotmain=mysql_query("select * from mos_content ORDER BY 'mainhot' DESC LIMIT 2 ") or die(mysql_error());
while ($donnee = mysql_fetch_array($hotmain))
{ $title= $donnee['title'];  
$introtext=$donnee['introtext'];
$author=$donnee['created_by'];
$sectionid=$donnee['sectionid'];
$displayhot=$donnee['displayhot'];
$mainhot=$donnee['mainhot'];
$mainhot_img=$donnee['mainhot_img'];

if ($mainhot==1)

{

echo "<tr><td id='maintitle'> EXCLUSIVE </td></tr>";
echo " <tr><td id='image'> <center> <a href='http://www.pspcave.com/'> <img src='$mainhot_img'></a></center></td></tr>";

echo "<tr><td id='articletitle'><center><a href='http://www.pspcave.com/'>";

echo $title;

echo "</a></center></td></tr>";

}

}

?>

</table>

[/code]


Ok so now the problem. This code manages to display 2 x the result since i set the Limit to 2. But it displays it one on top of each other, vertically.

Like

[result1]
[result2]

But i want it to display it horizontally, side by side

like
[result1] [result2]
I know the <td> and <tr> tags should be changed. but i have been sitting around messing around with them but have no idea how to do it to display correct.

Regards
OK, so that code wasn't hard at all... My bad.

I was thinking of something completely different.  Multiple columns but still with results going vertically, like this:

[code]
|---|---|
| 1 | 4 |
|---|---|
| 2 | 5 |
|---|---|
| 3 | 6 |
|---|---|
[/code]

Over complicating things again :)

Huggie

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.