diff --git a/src/ColumnTrait.php b/src/ColumnTrait.php index 063b4b35..fc394ad7 100644 --- a/src/ColumnTrait.php +++ b/src/ColumnTrait.php @@ -447,7 +447,7 @@ protected function parseFormat() Html::addCssClass($this->pageSummaryOptions, $class); Html::addCssClass($this->footerOptions, $class); } - if (trim($this->width) != '') { + if (null !== $this->width && trim($this->width) != '') { Html::addCssStyle($this->headerOptions, "width:{$this->width};"); Html::addCssStyle($this->pageSummaryOptions, "width:{$this->width};"); Html::addCssStyle($this->footerOptions, "width:{$this->width};"); @@ -516,7 +516,7 @@ protected function fetchContentOptions($model, $key, $index) if ($this->isValidAlignment('vAlign')) { Html::addCssClass($options, "kv-align-{$this->vAlign}"); } - if (trim($this->width) != '') { + if (null !== $this->width && trim($this->width) != '') { Html::addCssStyle($options, "width:{$this->width};"); } $options['data-col-seq'] = array_search($this, $this->grid->columns);