public function maketable($query, array $extra=null) {
    $table = "<table";
    if($extra['attr']) {
      $attr = $extra['attr'];
      foreach($attr as $k=>$v) {
        $table .= " $k='$v'";
      }
    }
    $table .= ">\n<thead>\n<tr>%<th>*</th>%</tr>\n</thead>";
    $rowdesc = "<tr><td>*</td></tr>";
    $delim = array("<td>", "</td>");
    $callback = $extra['callback']; // Before
    $callback2 = $extra['callback2']; // After
    
    $tbl = $this->makeresultrows($query, $rowdesc,
                                 array('return'=>true, callback=>$callback,
                                       callback2=>$callback2, header=>$table, delim=>$delim));

    if($tbl === false) {
      return false;
    }
    
    extract($tbl);

    $ftr = $extra['footer'] ? "<tfoot>\n{$extra['footer']}\n</tfoot>\n" : null;

    $ret = <<<EOF
$header
<tbody>
$rows</tbody>
$ftr
</table>

EOF;

    return array($ret, $result, $num, $header, table=>$ret, result=>$result, num=>$num, header=>$header);
  }