/** * renders rtf code for cell */ public function render() { $stream = $this->_rtf->getWriter(); $stream->write("\r\n"); // renders container elements parent::render(); $containerElements = $this->getElements(); $numOfContainerElements = count($containerElements); if ($this->_table->isNestedTable()) { // if last container element is not a nested table, close cell if ($numOfContainerElements == 0 || !$containerElements[$numOfContainerElements - 1] instanceof PHPRtfLite_Table_Nested) { $stream->write('{\\nestcell{\\nonesttables\\par}\\pard}' . "\r\n"); // if last cell of row, close row if ($this->getColumnIndex() == $this->_table->getColumnsCount()) { $stream->write('{\\*\\nesttableprops '); $row = $this->_table->getRow($this->_rowIndex); $this->_table->renderRowDefinition($row); $stream->write('\\nestrow}'); } } } else { if ($numOfContainerElements > 0 && $containerElements[$numOfContainerElements - 1] instanceof PHPRtfLite_Table_Nested) { $stream->write('\\intbl\\itap1\\~'); } // closing tag for cell definition $stream->write('\\cell'); } $stream->write("\r\n"); }