Hello, I was wondering if some could help me out with something. I am wanting to remove the space between the lines because it is throwing my tables off. You can see the spaces here

http://www.texascampingforum.com/2006/recent.php

Here is the code that produces it and I can't seem to find anything to remove the breaks.

<?
include("dbinfo2.inc.php");

$con = mysql_connect('localhost', $username, $password) or die('Unable to connect to localhost');
mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM phpbb_topics ORDER BY topic_last_post_id DESC LIMIT 5";
$result=mysql_query($query);

$num=mysql_num_rows($result);

mysql_close();

while ($row = mysql_fetch_array($result)) {

$topic_id = $row["topic_id"];
$topic_title = $row["topic_title"];
?>

<p align="left">
<font face="Arial Narrow" size="2"><?echo "<a href='".$forumroot."viewtopic.php?t=".$topic_id."'>$topic_title</a>$topic_time";?></font></p>
<?
}

?> 

-Thanks

    remove the <p> </p> tags then.

      Eew! <font> tags! 1990s retro!

      Like thorpe said, remove the <p> tags, and use <br /> instead.

      Or, seeing as it's an unordered list, use a <ul> and then style it to suit.

        Thanks for the reply, How do I align it then without the <p> tags without using CSS

        -Thanks

          Dada78 wrote:

          Thanks for the reply, How do I align it then without the <p> tags without using CSS

          -Thanks

          Divs but they again add line breaks....

          I suppose you could use somehting like a pre tag though :-)

          Cheers,

          Ryan Jones

            The better way of doing is use table tag and then in table use cellspacing=0 and cellpading=0 will reduce to min space b/w lines.
            use like this

            <?
            include("dbinfo2.inc.php");

            $con = mysql_connect('localhost', $username, $password) or die('Unable to connect to localhost');
            mysql_select_db($database) or die( "Unable to select database");
            $query="SELECT * FROM phpbb_topics ORDER BY topic_last_post_id DESC LIMIT 5";
            $result=mysql_query($query);

            $num=mysql_num_rows($result);

            mysql_close();
            echo "<table cellspacing=0 cellpading=0>";
            while ($row = mysql_fetch_array($result)) {

            $topic_id = $row["topic_id"];
            $topic_title = $row["topic_title"];
            ?>

            <tr><td align=left>
            <font face="Arial Narrow" size="2"><?echo "<a href='".$forumroot."viewtopic.php?t=".$topic_id."'>$topic_title</a>$topic_time";?></font></td></tr>
            <?
            }

            ?>
            </table>

              Or, you can just learn CSS and bite the bullet. Best bet: use an unordered list floated left:

              <ul><li style="float: left;">Link</li></ul>

              Or, just remove the <p> tags and rather use one <div> tag and list the links:

              echo '<div style="float: left;">';
              while ($row = mysql_fetch_array($result)) {
              
              $topic_id = $row["topic_id"];
              $topic_title = $row["topic_title"];
              ?>
              
              <font face="Arial Narrow" size="2"><?echo "<a href='".$forumroot."viewtopic.php?t=".$topic_id."'>$topic_title</a>$topic_time";?></font>
              <?
              }
              echo '</div>';
              ?>

              I'm pretty sure, you could even just do this:

              <p style="float: left; width: auto; text-align: left;">

              instead of

              <p align="left">

              ~Brett

                I know CSS I just can't use it in this file as it is included in a couple of places on my site as well as my mobile verison. Most mobile devices don't recgonized CSS. That's why it is done this way. So it would do me no good to use CSS as it is called to other sites that are affliated with mine.

                -Thanks

                  Write a Reply...