6 public function Table($colums) {
7 $this->table = array();
8 $this->table['set'] = array();
9 $this->table['data'] = array();
10 $this->table['set']['col'] = $colums;
11 $this->table['set']['bold'] = array();
12 for($i = 0; $i < $this->table['set']['col']; $i++) {
13 $this->table['set']['max'.$i] = 0;
14 $this->table['set']['bold'][$i] = false;
18 public function setBold($colum) {
19 $this->table['set']['bold'][$colum] = true;
22 public function add() {
23 $args = func_get_args();
25 for($i = 0; $i < $this->table['set']['col']; $i++) {
26 if(count($args) <= $i) $args[$i]= "";
28 if(count($args) >= $i)
29 if(strlen($args[$i]) > $this->table['set']['max'.$i]) $this->table['set']['max'.$i] = strlen($args[$i]);
31 $this->table['data'][] = $row;
35 public function end() {
38 for($row = 0; $row < count($this->table['data']); $row++) {
40 for($i = 0; $i < $this->table['set']['col']; $i++) {
41 if($i < $this->table['set']['col'] - 1)
42 $this->table['data'][$row][$i] .= substr($space,0,$this->table['set']['max'.$i] - strlen($this->table['data'][$row][$i]) + 1);
43 $bold = $this->table['set']['bold'][$i];
44 $out .= ($bold ? "\002" : "").$this->table['data'][$row][$i].($bold ? "\002" : "");