thomascube
2008-06-24 eec34efac2f61ca05fcb7930df39abfc4cd3f503
program/include/html.php
@@ -571,7 +571,7 @@
     * @param array Cell attributes
     * @param string Cell content
     */
    private function add_header($attr, $cont)
    public function add_header($attr, $cont)
    {
        if (is_string($attr))
        $attr = array('class' => $attr);
@@ -587,7 +587,7 @@
     *
     * @param array Row attributes
     */
    private function add_row($attr = array())
    public function add_row($attr = array())
    {
        $this->rowindex++;
        $this->colindex = 0;
@@ -603,16 +603,18 @@
     * @param array Table attributes
     * @return string The final table HTML code
     */
    public function show($attr = array())
    public function show($attrib = null)
    {
        $this->attrib = array_merge($this->attrib, $attr);
        $thead = $tbody = "";
   if (is_array($attrib))
           $this->attrib = array_merge($this->attrib, $attrib);
   $thead = $tbody = "";
        // include <thead>
        if (!empty($this->header)) {
            $rowcontent = '';
            foreach ($this->header as $c => $col) {
                $rowcontent .= self::tag('th', $col->attrib, $col->content);
                $rowcontent .= self::tag('td', $col->attrib, $col->content);
            }
            $thead = self::tag('thead', null, self::tag('tr', null, $rowcontent));
        }
@@ -624,7 +626,7 @@
            }
            if ($r < $this->rowindex || count($row->cells)) {
                $tbody .= self::tag('tr', $rows->attrib, $rowcontent);
                $tbody .= self::tag('tr', $row->attrib, $rowcontent);
            }
        }