F
Filament3d ago
kabu

Table responsive, using Table Builder Layout

Its possible to make two layouts for sm and md ? for md screens i want this simple layout: public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('id') ->label(('id')) ->searchable() ->sortable(), Tables\Columns\TextColumn::make('name') ->label(('name')) ->searchable() ->sortable(), Tables\Columns\TextColumn::make('name') ->label(('name')) ->description('') ->searchable() ->sortable(), Tables\Columns\TextColumn::make('email') ->label(('email')) ->searchable() ->sortable(), Tables\Columns\TextColumn::make('phone') ->label(('phone')) ->searchable() ->sortable(), Tables\Columns\TextColumn::make('phone2') ->label(('second_phone')) ->searchable() ->visibleFrom('md')//nomes es mostra en pantalles grans ->sortable(), Tables\Columns\TextColumn::make('clientCategory.name') ->label(__('category')) ->sortable() ->visibleFrom('md') ->toggleable(), ]) And for sm i want to stack name email and phone.
2 Replies
Mohamed Ayaou
Mohamed Ayaou3d ago
most of filament layout methods accepts an array like
Grid::make('layout')
->columns([
'default' => 1
'sm' => 3,
'xl' => 6,
'2xl' => 8,
])
Grid::make('layout')
->columns([
'default' => 1
'sm' => 3,
'xl' => 6,
'2xl' => 8,
])

Did you find this page helpful?