Getting a linkable table of children in hook_block_view from taxonomy_get_children (Drupal 7) I am trying to programmatically create a block that will display all of the children of the term being referenced by the current page in a linkable table (so that I can click on any of the taxonomy terms and then go to their page).  So far I have managed to create an ordered list of children names with the following code: 

function children_view_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'children':
      $path = explode('/', drupal_get_path_alias($_GET['q']));

      $tid = array_pop($path);
      $term = taxonomy_term_load($tid);
      $children = taxonomy_get_children($term-&gt;tid, $term-&gt;vid);
      $stack = array();

      foreach ($children as $child) {
        array_push($stack,$child-&gt;name);
      }

      $theme_args = array('items' =&gt; $stack, 'type' =&gt; 'ol');
      $content = theme('item_list' , $theme_args);

      $block = array(
        'subject' =&gt; t('Children'),
        'content' =&gt; $content
      );
    break; 
  }
  return $block;
}


But what I really want is a table that might contain some other details about the taxonomies but more importantly I would like each taxonomy in the list to be a link that will take me to that taoxnomies term page.  I image the reason these terms are not linkable is because I am only passing the name into the array but when I tried to pass the actual term into the array I get an error from the theme module.  How would I make these linkable?  Also, I imagine that I could change the ordered list into a table by replacing the 'ol' in the call:

      $theme_args = array('items' =&gt; $stack, 'type' =&gt; 'ol');


with a table but I am not sure what I would pass instead of 'ol' and I could not find any documentation about this.  Could anyone link me to such documentation?
You can use the l() function to create the link to each term, and the theme_table() function to build your table:

function children_view_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'children':
      $path = explode('/', drupal_get_path_alias($_GET['q']));

      $tid = array_pop($path);
      $term = taxonomy_term_load($tid);

      // Set up the table rows and headers array
      $rows = array();
      $header = array('Link', 'Vocab ID');

      $children = taxonomy_get_children($term-&gt;tid, $term-&gt;vid);

      // Add a new row for each child term
      foreach ($children as $child) {
        $rows[] = array(
          l($child-&gt;name, "taxonomy/term/$child-&gt;tid"),
          $child-&gt;vid
        );
      }

      // Set up the params for the theme_table call
      $table = array('rows' =&gt; $rows, 'header' =&gt; $header, 'empty' =&gt; 'No terms found');

      $block['subject'] = t('Children');
      $block['content'] = theme('table', $table);

      break;
  }

  return $block;
}


I've put a second column in there (Vocab ID) just as an example of how to add extra columns to the table.