/** * * @param DOMElement $table * @param PHPWord_Section_Table $mainTable * @return boolean */ protected function _addTableFooter($table, $mainTable) { $tfoot = $table->getElementsByTagName('tfoot'); if (empty($tfoot->length)) { return false; } $tfoot = $tfoot->item(0); $rows = $tfoot->getElementsByTagName('tr'); foreach ($rows as $row) { $mainTable->addRow(); $cells = $row->getElementsByTagName('th'); $fontStyle = array('color' => '999999', 'bold' => 'Bold'); $cellStyle = array('bgColor' => 'FCFCFC'); // Insert each row cell foreach ($cells as $cell) { $this->_addCell($cell, $mainTable, $cellStyle, $fontStyle, array()); } } }