_insideOf = $insideOf; $this->_pCount = $pCount; if(!is_null($style)) { if(is_array($style)) { $this->_style = new PHPWord_Style_Table(); foreach($style as $key => $value) { if(substr($key, 0, 1) != '_') { $key = '_'.$key; } $this->_style->setStyleValue($key, $value); } } else { $this->_style = $style; } } } /** * Add a row * * @param int $height */ public function addRow($height = null) { $this->_rows[] = array(); $this->_rowHeights[] = $height; } /** * Add a cell * * @param int $width * @param mixed $style * @return PHPWord_Section_Table_Cell */ public function addCell($width, $style = null) { $cell = new PHPWord_Section_Table_Cell($this->_insideOf, $this->_pCount, $width, $style); $i = count($this->_rows) - 1; $this->_rows[$i][] = $cell; return $cell; } /** * Get all rows * * @return array */ public function getRows() { return $this->_rows; } /** * Get all row heights * * @return array */ public function getRowHeights() { return $this->_rowHeights; } /** * Get table style * * @return PHPWord_Style_Table */ public function getStyle() { return $this->_style; } } ?>