# [Usage](../../../../usage.md) > [Components](../../basics.md) > [Visuals](../../basics.md) > [Table](../table.md) > TableColumn: grouping

### `groupable` | `->setGroupable()`
Enables the column to be available from group by value, it means that the record with the same value for that column will be grouped.

| Types     | Default |
|-----------|---------|
| `boolean` | `false` |

After set the `groupable`, you can specify a description calculated using the group, on the specific `TableColumn`:

### `groupDescription` | `->setGroupDescription()`
It will add a custom description to each group when grouping for the specific column. It handle also `Closure` and each receive the `$group` as callback. The `$group` is the label of the group, generated by the table.

Example:

```php
TableColumn::make('sale.code')
  ->setLabel('Sale code')
  ->setGroupDescription(function ($record) {
      return 'Created in date: ' . $record->sale->created_at;
  })
```

In this example the relationship `sale.code` of the query is displayed. And as group description is displayed the creation date of the `sale`.


| Types    | Default |
|----------|---------|
| `string` | `null`  |

Static vs dynamic: `setGroupable()` only groups the rows already loaded (static `values` tables group in the browser; dynamic `query` tables group the fetched page/server rows). `setGroupDescription()` accepts a plain string (static label per group) or a Closure receiving `$group` (dynamic label, resolved in `prepareGroupDescriptions()` with `$query`, `$originalQuery` and `$customFilters` available).

Minimal working example — Blade:
```php
{!!
    \KFramework\Components\Visual\Table::make()
        ->setSchema([
            \KFramework\Components\Visual\TableColumn::make('sale.code')
                ->setLabel('Sale code')
                ->setGroupable()
                ->setGroupDescription(fn ($group) => 'Sale: ' . $group),
        ])
        ->setQuery($ordersQuery)
!!}
```
Controller:
```php
TableColumn::make('sale.code')
    ->setLabel('Sale code')
    ->setGroupable()
    ->setGroupDescription(fn ($group) => 'Sale: ' . $group);
```
What the user sees: a "group by" control listing groupable columns; choosing one collapses rows with equal values under labeled group headers.

Interaction:
- Pairs with [sortable](tablecolumn_sortable.md) (order rows inside groups) and [searchable](tablecolumn_searchable.md) (search within grouped data).
- Group keys support `relation.column` (e.g. `sale.code`); combine with [query](table_query.md) so relations resolve server-side.
- Descriptions can reuse the [custom filters](table_customfilters.md) state passed to the closure.

See also: [Table](../table.md), [Components basics](../../basics.md), [sortable](tablecolumn_sortable.md), [query](table_query.md).