375 if (count($this->_rows) === 0) {
376 #require_once 'Zend/Text/Table/Exception.php'; 384 $totalNumColumns = count($this->_columnWidths);
387 $numRows = count($this->_rows);
388 foreach ($this->_rows as $rowNum =>
$row) {
390 if (isset($columnWidths) ===
true) {
391 $lastColumnWidths = $columnWidths;
394 $renderedRow =
$row->render($this->_columnWidths, $this->_decorator, $this->_padding);
395 $columnWidths =
$row->getColumnWidths();
401 $result .= $this->_decorator->getTopLeft();
403 foreach ($columnWidths as $columnNum => $columnWidth) {
404 $result .= str_repeat($this->_decorator->getHorizontal(),
408 $result .= $this->_decorator->getTopRight();
410 $result .= $this->_decorator->getHorizontalDown();
417 if ($this->_autoSeparate & self::AUTO_SEPARATE_ALL) {
418 $drawSeparator =
true;
419 }
else if ($rowNum === 1 && $this->_autoSeparate & self::AUTO_SEPARATE_HEADER) {
420 $drawSeparator =
true;
421 }
else if ($rowNum === ($numRows - 1) && $this->_autoSeparate & self::AUTO_SEPARATE_FOOTER) {
422 $drawSeparator =
true;
424 $drawSeparator =
false;
427 if ($drawSeparator) {
428 $result .= $this->_decorator->getVerticalRight();
430 $currentUpperColumn = 0;
431 $currentLowerColumn = 0;
432 $currentUpperWidth = 0;
433 $currentLowerWidth = 0;
436 foreach ($this->_columnWidths as $columnNum => $columnWidth) {
438 $result .= str_repeat($this->_decorator->getHorizontal(),
442 if (($columnNum + 1) === $totalNumColumns) {
448 $currentUpperWidth += $columnWidth;
449 $currentLowerWidth += $columnWidth;
451 if ($lastColumnWidths[$currentUpperColumn] === $currentUpperWidth) {
453 $currentUpperColumn += 1;
454 $currentUpperWidth = 0;
456 $currentUpperWidth += 1;
459 if ($columnWidths[$currentLowerColumn] === $currentLowerWidth) {
461 $currentLowerColumn += 1;
462 $currentLowerWidth = 0;
464 $currentLowerWidth += 1;
467 switch ($connector) {
469 $result .= $this->_decorator->getHorizontal();
473 $result .= $this->_decorator->getHorizontalUp();
477 $result .= $this->_decorator->getHorizontalDown();
481 $result .= $this->_decorator->getCross();
490 $result .= $this->_decorator->getVerticalLeft() .
"\n";
498 if (($rowNum + 1) === $numRows) {
499 $result .= $this->_decorator->getBottomLeft();
501 foreach ($columnWidths as $columnNum => $columnWidth) {
502 $result .= str_repeat($this->_decorator->getHorizontal(),
506 $result .= $this->_decorator->getBottomRight();
508 $result .= $this->_decorator->getHorizontalUp();