Browse Source

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.
thinkingmedia 9 years ago
parent
commit
bc2e8285cb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Shell/Helper/TableHelper.php

+ 1 - 1
src/Shell/Helper/TableHelper.php

@@ -45,7 +45,7 @@ class TableHelper extends Helper
         foreach ($rows as $line) {
             foreach ($line as $k => $v) {
                 $columnLength = mb_strwidth($line[$k]);
-                if ($columnLength > (isset($widths[$k]) ? $widths[$k] : 0)) {
+                if ($columnLength >= (isset($widths[$k]) ? $widths[$k] : 0)) {
                     $widths[$k] = $columnLength;
                 }
             }