public function addHeader(array $header) { $this->addHead(); $row = new BaseNode("th"); foreach ($header as $item) { $rowContent = new basenode("td"); $rowContent->setText($item); $row->addChildren($rowContent); } $this->head->addChildren($row); }