Jump to content

[SOLVED] Displaying categories


graham23s

Recommended Posts

Hi Guys,

 

i can display my categories fine using this code:

 

        echo '<br />
              <table width="750" border="2" bordercolor="#004E98" cellpadding="5" cellspacing="0">
              <tr>
              <td colspan="5" bgcolor="#004E98"><img src="images/browse_categories.bmp"></td>
              </tr>';

        while ($category = mysql_fetch_assoc($query_browse)) {
            
        $cat_id_gif = $category['id'];
        
            if ($count == 5) { 
            
                echo '<tr>';
                
                $count = 0;
                
            }
        
        echo '<td class="release" align="release"><b><a href="browse.php?cat_id='.$category['id'].'">'.$category['name'].'</b></a></td>';
            
                $count++;  
          
            }
            
        echo '</tr></table>';

 

only thing is say i have 2 table cells empty, in firefox its a jumbled mess , it better in interntet exlorer just, basically i need to place a:   to fill up the empty cell to keep it stable but im not sure where in the code to do it

 

any help would be appreciated

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/67803-solved-displaying-categories/
Share on other sites

...
  echo '<td class="release" align="release"><b><a href="browse.php?cat_id='.$category['id'].'">'.$category['name'].'</b></a></td>';
  $count++;  
}
//insert line
if($count > 1) for($I = $count; $i <= 5; $i++)echo '<td> </td>';
            
echo '</tr></table>';

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.