var $header_color = "#f7c871"; function Table($headers, $alt_row_colors = false, $border = false) $this->headers = $headers; $this->alt_row_colors = $alt_row_colors; for ($i = 0; $i < count($headers); $i++) $this->header_aligns[$i] = ""; function set_header_align($col, $align) $this->header_aligns[$col] = $align; function set_widths($widths) function add_row($values, $info = 0) $this->rowinfo[] = $info; function set_alignment($col, $align) $this->alignments[$col] = $align; function set_valignment($col, $align) $this->valignments[$col] = $align; $row_size = count($this->rows); print "<table border=\"0\" cellspacing=\"0\""; print " cellpadding=\"1\" width=\"100%\">\n"; print " <td bgcolor=\"#000000\">\n"; print "<table border=\"0\" cellspacing=\"0\""; print " cellpadding=\"3\" width=\"100%\">\n"; if (is_array($this->headers)) $header_size = count ($this->headers); for ($i = 0; $i < $header_size; $i++) print " <td bgcolor=\"" . $this->header_color . "\""; print " nowrap=\"nowrap\""; if ($this->header_aligns[$i] != "") print " align=\"" . $this->header_aligns[$i] . "\""; print " width=\"" . $this->widths[$i] . "\""; print "<b>" . $this->headers[$i] . "</b>"; for ($i = 0; $i < $row_size; $i++) $col_count = count($this->rows[$i]); for ($j = 0; $j < $col_count; $j++) if ($this->alt_row_colors == true) print " bgcolor=\"#F0F0F0\""; print " bgcolor=\"#FFFFFF\""; if ($i == 0 && $this->headers == 0) print " width=\"" . $this->widths[$i] . "\""; if ($this->alignments != 0 && $this->alignments[$j]) print " align=\"" . $this->alignments[$j] . "\""; if ($this->valignments != 0 && $this->valignments[$j]) print " valign=\"" . $this->valignments[$j] . "\""; if ($this->rowinfo[$i] != 0 && $this->rowinfo[$i][$j] != 0) while (list($var, $val) = each($this->rowinfo[$i][$j])) print $this->rows[$i][$j]; print "</td></tr></table>\n";