Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions lib/cli/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,16 @@ public function display() {
public function displayRow(array $row) {
// Update widths if this row has wider content
$row = $this->checkRow($row);

// Recalculate widths for the renderer
$this->_renderer->setWidths($this->_width, false);

$rendered_row = $this->_renderer->row($row);
$row_lines = explode( PHP_EOL, $rendered_row );
foreach ( $row_lines as $line ) {
Streams::line( $line );
}

$border = $this->_renderer->border();
if (isset($border)) {
Streams::line( $border );
Expand Down Expand Up @@ -203,10 +203,12 @@ public function getDisplayLines() {
$out[] = $border;
}

foreach ($this->_rows as $row) {
$row = $this->_renderer->row($row);
$row = explode( PHP_EOL, $row );
$out = array_merge( $out, $row );
if ($this->_rows) {
foreach ($this->_rows as $row) {
$row = $this->_renderer->row($row);
$row = explode( PHP_EOL, $row );
$out = array_merge( $out, $row );
}
}

// Only add final border if there are rows
Expand Down