Gets how many XHTML table columns the visible column objects of this
table-view object span on display

@return integer the number of XHTML table columns the visible column
objects of this table-view object span on display.
199328
public function getXhtmlColspan()
    {
        $colspan = 0;

        // Add all colspans of visible columns to get table colspan.
        foreach ($this->getVisibleColumns() as $column) {
            $colspan += $column->getXhtmlColspan();
        }

        // Check each spanning column. If it has more colspan than the colspan
        // defined by the columns, set the table colspan to the spanning column
        // colspan.
        foreach ($this->getVisibleSpanningColumns() as $column) {
            $spanning_colspan = $column->getXhtmlColspan();
            if ($spanning_colspan > $colspan) {
                $colspan = $spanning_colspan;
            }
        }

        return $colspan;
    }
68494
public function getColumnWidths()
    {
        $data = ArrayList::create();
        
        $widths = $this->getColumnWidthData();
        
        foreach ($widths->getViewports() as $viewport) {
            
            if ($value = $widths->getField($viewport)) {
                
                $gutter = (int) $this->Gutter;
                
                if ($this->ColumnUnitCSS == '%') {
                    $gutter = $gutter - ($gutter * ($value / 100));
                }
                
                $data->push(
                    ArrayData::create([
                        'Unit' => $this->ColumnUnitCSS,
                        'Width' => sprintf('%F%s', $value, $this->ColumnUnitCSS),
                        'Gutter' => $gutter,
                        'Breakpoint' => $widths->getBreakpoint($viewport)
                    ])
                );
                
            }
            
        }
        
        return $data;
    }
1310432
public function getHtmlColumnHeader(): string
  {
    $attributes = [];
    $classes    = [];

    if ($this->headerText===null)
    {
      $classes[] = 'empty';
    }
    else
    {
      if ($this->sortable)
      {
        // Add class indicating this column can be used for sorting.
        $classes[] = 'sort';

        // Add attributes indicating the sort order of this column and direction.
        if ($this->sortOrder!==null)
        {
          $attributes['data-sort-order'] = $this->sortOrder;

          $classes[] = ($this->sortDirection=='desc') ? 'sorted-desc' : 'sorted-asc';
        }
      }
    }

    $attributes['class'] = implode(' ', $classes);

    return Html::generateElement('th', $attributes, $this->headerText);
  }
394046
private function getColumns()
    {
        $dimensions = $this->getApplication()->getTerminalDimensions();
        if (is_array($dimensions) && count($dimensions) > self::DIMENSION_WIDTH) {
            return $dimensions[self::DIMENSION_WIDTH];
        } else {
            return self::DEFAULT_WIDTH;
        }
    }
440690
public function count() {
		if(!$this->initialized)
			$this->initialize();

		return count($this->elements) - count($this->toRemove) + count($this->toAdd);
	}
1152942
protected function columns()
    {
        $this->data    = $this->setData();
        $column_widths = $this->getColumnWidths();
        $output        = [];
        $count         = count(reset($this->data));

        for ($i = 0; $i < $count; $i++) {
            $output[] = $this->getRow($i, $column_widths);
        }

        return $output;
    }
277204
public function getDataRowHTML()
    {
        $output = [];
        foreach ($this->columns as $name => $column) {

            // If multiple formatters are defined, use the first for the header cell

            if (!is_int($name)) {
                $field = $this->model->getElement($name);
            } else {
                $field = null;
            }

            if (!is_array($column)) {
                $column = [$column];
            }

            // we need to smartly wrap things up
            $cell = null;
            $cnt = count($column);
            $td_attr = [];
            foreach ($column as $c) {
                if (--$cnt) {
                    $html = $c->getDataCellTemplate($field);
                    $td_attr = $c->getTagAttributes('body', $td_attr);
                } else {
                    // Last formatter, ask it to give us whole rendering
                    $html = $c->getDataCellHTML($field, $td_attr);
                }

                if ($cell) {
                    if ($name) {
                        // if name is set, we can wrap things
                        $cell = str_replace('{$'.$name.'}', $cell, $html);
                    } else {
                        $cell = $cell.' '.$html;
                    }
                } else {
                    $cell = $html;
                }
            }

            $output[] = $cell;
        }

        return implode('', $output);
    }
59083
public function getNumberOfElements(): ?int
    {
        $this->checkRepository();

        return $this->_em->createQueryBuilder()
            ->select('count(a)')
            ->from($this->getEntityName(), 'a')
            ->getQuery()
            ->getSingleScalarResult()
        ;
    }
735024
public function getVisibleColumns()
    {
        $columns = array();
        foreach ($this->columns as $column) {
            if ($column->visible) {
                $columns[] = $column;
            }
        }

        return $columns;
    }
835651
public function count() {
		if ($this->count === null) {
			$groupPart = $this->select->getPart(Select::GROUP);
			
			$select = empty($groupPart)
				? $this->prepareSelect(clone $this->select)
				: $this->prepareSubquerySelect(clone $this->select);
			
			$this->count = (int) $select->query(PDO::FETCH_OBJ)->fetch()->{self::COUNT_COLUMN};
		}
		
		return $this->count;
	}
631579
public function get_column_count()
    {
        list($columns, $hidden) = $this->get_column_info();

        $hidden = array_intersect(array_keys($columns), array_filter($hidden));
        return count($columns) - count($hidden);
    }
235193
function get_col_num(){
		if( ! isset($this->c) ){
			if( isset($this->children[0]) ){
				$this->c = $this->children[0]->get_col_num();
			}
			else {
				$this->c = 0;
			}
		}
		return $this->c;
	}
955284
public function colCount() {
		$count=$this->count();
		if ($this->hasOnlyCols($count))
			return $count;
		if ($count > 0)
			return $this->getItem(0)->count();
		return 0;
	}
288392
public function getColumns()
	{
		$return = $this->columns;

		try {
			$this->getParent();

			if (!$this->getSessionData('_grid_hidden_columns_manipulated', false)) {
				$columns_to_hide = [];

				foreach ($this->columns as $key => $column) {
					if ($column->getDefaultHide()) {
						$columns_to_hide[] = $key;
					}
				}

				if (!empty($columns_to_hide)) {
					$this->saveSessionData('_grid_hidden_columns', $columns_to_hide);
					$this->saveSessionData('_grid_hidden_columns_manipulated', true);
				}
			}

			$hidden_columns = $this->getSessionData('_grid_hidden_columns', []);

			foreach ($hidden_columns as $column) {
				if (!empty($this->columns[$column])) {
					$this->columns_visibility[$column] = [
						'visible' => false,
					];

					unset($return[$column]);
				}
			}

		} catch (DataGridHasToBeAttachedToPresenterComponentException $e) {
		}

		return $return;
	}
216464
public function getColumns()
    {
        $columns = [];

        foreach ($this->columns as $field => $fieldTitle) {
            if (in_array($field, $this->model->getFillable())) {
                if (!$field) {
                    $field = $fieldTitle;
                    $fieldTitle = Str::title($fieldTitle);
                }
                $columns[$field] = $fieldTitle;
                continue;
            }

            // We can replace this with data_get() I believe.
            if (($methodBreaker = strpos($field, '.')) !== false) {
                $method = substr($field, 0, $methodBreaker);
                if (method_exists($this->model, $method)) {
                    if (method_exists($this->model->$method(), $submethod = str_replace($method.'.', '', $field))) {
                        $this->model->$method()->$submethod();

                        $columns[$field] = $fieldTitle;
                        continue;
                    }
                }
            }

            if (is_numeric($field)) {
                $field = $fieldTitle;
                $fieldTitle = Str::title($fieldTitle);
            }

            $columns[$field] = $fieldTitle;
        }

        if (count($columns)) {
            return $columns;
        }

        return [$this->model->getKeyName() => $this->model->getKeyName()];
    }
783455
public function getColsXml()
    {
        $colsXml = '';
        if (0 !== count($this->getColumnWidths())) {
            foreach ($this->getColumnWidths() as $columnIndex => $columnWidth) {
                $columnNumber = $columnIndex + 1;
                $colsXml .= sprintf(
                    SheetXml::COLUMN_XML, $columnNumber, $columnNumber, number_format($columnWidth, 3, '.', '')
                );
            }
            $colsXml = sprintf('<cols>%s</cols>', $colsXml);
        }

        return $colsXml;
    }
633676
protected function getTableColumns()
    {
        if (0 === count(self::$tableColumns)) {
            $table = $this->getTable();
            $connect = $this->getConnection();
            $builder = $connect->getSchemaBuilder();
            $columns = $builder->getColumnListing($table);

            self::$tableColumns = (array)$columns;
        }
        return self::$tableColumns;
    }