• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Remove gap between directory listings


 Please take a look here -


and then take a look at the link below

I want my category listings to display similar to this...


That is each category listing is immediately followed by another one without too much gap.

As you can see in the current site, each column for category listing is of similar height.. so when a category has lesser number of sub-categories, the gap between the two listings becomes too wide.

I'm attaching below the php code that outputs the css code displsying the lists... The exact code that outputs css is highlighted in bold.   The respective style classes/tags are provided as well.

   if ($cnt >= $thiscolcats)
       $thiscolcats = ($col > $longcols) ? $percol_short : $percol_long;
       $cnt = 0;
       echo "<td valign=\"top\" width=\"$cell_width%\">";


    $catlink = buildURL("ads", array($xcityid, $rowcat['catid'], $rowcat['catname']));

   $adcount = 0+$catadcounts[$rowcat['catid']];


   <div class="left_2" id="left_2">
   <div class="content_title" >
   <img src="images/category.gif" border="0" align="absmiddle">
   <a href="<?php echo $catlink; ?>"><?php echo $rowcat['catname']; ?></a>
   <?php if($show_cat_adcount) { ?><span class="count">(<?php echo $adcount; ?>)</span><?php } ?>
   <hr align="left" class="content_line"/>


   $sql = "SELECT scat.subcatid, scat.subcatname AS subcatname
   FROM $t_subcats scat
   WHERE scat.catid = $rowcat[catid]
       AND scat.enabled = '1'

   $ressubcats = mysql_query($sql) or die(mysql_error()."<br>$sql");
   $subcatcount = mysql_num_rows($ressubcats);

   while ($rowsubcat = mysql_fetch_array($ressubcats))

       if ($shortcut_categories && $subcatcount == 1
               && $rowsubcat['subcatname'] == $rowcat['catname']) {
       $adcount = 0+$subcatadcounts[$rowsubcat['subcatid']];

       $subcat_url = buildURL("ads", array($xcityid, $rowcat['catid'], $rowcat['catname'],
           $rowsubcat['subcatid'], $rowsubcat['subcatname']));

       <table width="130px"><tr><td align="left" valign="top"><a href="<?php echo $subcat_url; ?>"><?php echo $rowsubcat['subcatname']; ?></a>
       <?php if($show_subcat_adcount) { ?><span class="count">(<?php echo $adcount; ?>)</span></td></tr></table><?php } ?>




Css inside external css file:

#main_content { width:59%; height:auto;float:left;  }

.content_title {padding:2%; text-align:center; color:#BB532E;font-weight:bold;font-size:95%;font-family:Arial, Helvetica, sans-serif; }

.left_2 { margin-left:3%; width:23.5%; height:auto; float:left; }

Open in new window

1 Solution
Would you be after something like this?
ee-itproAuthor Commented:
not a solution to my problem but appreciate the help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now