"width:100%;" ) ); $this->theader = new Html("thead"); $this->add($this->theader); if (! is_array($headersName) ) throw new \Exception( "no header for HtmlArray :".DwLogger::print_r( $headersName ) ); else { $this->cptHeader=0; $lineTr = new Html( "tr" );$this->theader->add( $lineTr ); foreach($headersName as $headerName) { $cellTh = new Html( "th" );$lineTr->add( $cellTh ); $cellTh->add("|| $headerName ||"); $this->cptHeader++; } } $this->tbody = new Html("tbody"); $this->add($this->tbody); } public function _print( $dataArray = null ) { $this->tbody->clear(); if ( ! is_array( $dataArray ) ) throw new \Exception( "no data for HtmlArray :".DwLogger::print_r( $dataArray ) ); else { foreach( $dataArray as $data ) { $lineTr = new Html( "tr" );$this->tbody->add( $lineTr ); for($cpt=0;$cpt<$this->cptHeader;$cpt++) { $cellTd = new Html( "td" );$lineTr->add( $cellTd ); if ( ! isset($data[$cpt]) ) $cellTd->add("xxx - no data - xxx"); else { $cellTd->add($data[$cpt]); } } } } } } ?>