Skip to content
Permalink
Browse files

fixed empty string bug

Widths for columns that contain an empty string are not added, and
produces a bug where there are fewer headings then columns per row.
  • Loading branch information...
thinkingmedia
thinkingmedia committed Jan 6, 2017
1 parent 9520f59 commit bc2e8285cb4368a81ea85e457627cd6f6a3381dd
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Shell/Helper/TableHelper.php
@@ -45,7 +45,7 @@ protected function _calculateWidths($rows)
foreach ($rows as $line) { foreach ($rows as $line) {
foreach ($line as $k => $v) { foreach ($line as $k => $v) {
$columnLength = mb_strwidth($line[$k]); $columnLength = mb_strwidth($line[$k]);
if ($columnLength > (isset($widths[$k]) ? $widths[$k] : 0)) { if ($columnLength >= (isset($widths[$k]) ? $widths[$k] : 0)) {
$widths[$k] = $columnLength; $widths[$k] = $columnLength;
} }
} }

0 comments on commit bc2e828

Please sign in to comment.
You can’t perform that action at this time.