File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ public function display() {
136136 * @return array
137137 */
138138 public function getDisplayLines () {
139- $ this ->_renderer ->setWidths ($ this ->_width );
139+ $ this ->_renderer ->setWidths ($ this ->_width , $ fallback = true );
140140 $ border = $ this ->_renderer ->border ();
141141
142142 $ out = array ();
Original file line number Diff line number Diff line change @@ -32,9 +32,16 @@ class Ascii extends Renderer {
3232 /**
3333 * Set the widths of each column in the table.
3434 *
35- * @param array $widths The widths of the columns.
35+ * @param array $widths The widths of the columns.
36+ * @param bool $fallback Whether to use these values as fallback only.
3637 */
37- public function setWidths (array $ widths ) {
38+ public function setWidths (array $ widths , $ fallback = false ) {
39+ if ($ fallback ) {
40+ foreach ( $ this ->_widths as $ index => $ value ) {
41+ $ widths [$ index ] = $ value ;
42+ }
43+ }
44+ $ this ->_widths = $ widths ;
3845
3946 if ( is_null ( $ this ->_constraintWidth ) ) {
4047 $ this ->_constraintWidth = (int ) Shell::columns ();
Original file line number Diff line number Diff line change @@ -25,9 +25,15 @@ public function __construct(array $widths = array()) {
2525 /**
2626 * Set the widths of each column in the table.
2727 *
28- * @param array $widths The widths of the columns.
28+ * @param array $widths The widths of the columns.
29+ * @param bool $fallback Whether to use these values as fallback only.
2930 */
30- public function setWidths (array $ widths ) {
31+ public function setWidths (array $ widths , $ fallback = false ) {
32+ if ($ fallback ) {
33+ foreach ( $ this ->_widths as $ index => $ value ) {
34+ $ widths [$ index ] = $ value ;
35+ }
36+ }
3137 $ this ->_widths = $ widths ;
3238 }
3339
You can’t perform that action at this time.
0 commit comments