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

If set, the column content will be ignored and replaced by this value. Useful when using custom columns for dynamic tables (where a query is involved), but the column does not exist in query fields. Also, can receive a closure with the record for manipulation:

```php
\KFramework\Components\Visual\TableColumn::make('id')
->setLabel('ID')
->setValue(function ($record) {
return 'Q-' . $record->id;
})
```
or:
```php
\KFramework\Components\Visual\TableColumn::make('custom_column')
->setLabel('Random label')
->setValue(function () {
return 'value';
})
```

Note that the column will still be sorted by original value fetched by the query.

### `value` | `->setValue()`

| Types              | Default |
|--------------------|---------|
| `mixed`, `Closure` | `null`  |

Static vs dynamic: in static (`values`) tables `setValue()` simply replaces the cell content. In dynamic (`query`) tables the closure form receives `$record` (plus `$query`, `$originalQuery`, `$customFilters`, `$search`, resolved in `formatData()`), so one column can render computed output for a field that does not exist in the query.

Minimal working example — Blade:
```php
{!!
    \KFramework\Components\Visual\Table::make()
        ->setSchema([
            \KFramework\Components\Visual\TableColumn::make('id')->setLabel('ID')
                ->setValue(fn ($record) => 'Q-' . $record->id),
        ])
        ->setQuery($ordersQuery)
!!}
```
Controller:
```php
TableColumn::make('custom_column')
    ->setLabel('Random label')
    ->setValue(fn () => 'value');
```
What the user sees: the cell shows the returned value (e.g. `Q-42`) instead of the raw field; sorting still uses the original query value.

Interaction:
- Pairs with [query](table_query.md): required for the `$record` closure form.
- A value column is not [searchable](tablecolumn_searchable.md) / [sortable](tablecolumn_sortable.md) unless its field exists in the query — use `->addSelect()` if needed.
- Combine with [maxContent](tablecolumn_maxcontent.md) to size computed badges to their content.

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