Jump to content


Photo

fluid collapsible table with php?


  • Please log in to reply
No replies to this topic

#1 TheFigster

TheFigster
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 02 July 2006 - 06:55 PM

I'm perty sure this can be done, I just don't know how. I want to change this category map (not Menu) to be fluid and collapsible. This is my current code:
$c = $this->Categories;

$categorymap = '';
$count = 0;
for ($i=0; $i<sizeof($c); $i++){

   if ($c[$i]->parentid == 0){
     $count++;
     if ($count == 1){
         $categorymap .= '<tr>';
     }
     $categorymap .= '<td valign=top>'."<a style='font-size:110%' href='{$c[$i]->url}'>{$c[$i]->title}</a>".'<br>';
     for ($k=0; $k<sizeof($c); $k++){
        if ($c[$k]->parentid == $c[$i]->id){   //subcategory
           $categorymap .= " &nbsp; <a href='{$c[$k]->url}'>{$c[$k]->title}</a>" .'<br>';
        }
     }
     $categorymap .= '</td>';
     if ($count == 3){
         $categorymap .= '</tr>';
         $count = 0;
     }
   }
}
if ($count != 0){
   $categorymap .= '</tr>';
}

What do I need to change to get this to look even and be collapsible?

I Apreciate the help!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users