Skip to content

Commit e0e43eb

Browse files
mwagenadanharrin
andauthored
Stacked table rows on mobile (#19113)
* Adding option to stack the table cells on mobile while maintaining horizontal scroll on larger screens * cs fix * applied styling to columns and headers * applied styling to work in combination with hiddenFrom and visibleFrom * moved the tailwind classes into css files * cleanup * Update table.css * Update index.blade.php * tweaks * styling * edge cases * fixes * screenshots * cleanup * rebuild * rename * fix warning * Update CanBeStackedOnMobile.php --------- Co-authored-by: Dan Harrin <git@danharrin.com>
1 parent 6411055 commit e0e43eb

File tree

55 files changed

+426
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+426
-9
lines changed

docs-assets/app/app/Livewire/TablesDemo.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,20 @@ public function layoutGrid(Table $table): Table
12551255
->defaultPaginationPageOption(6);
12561256
}
12571257

1258+
public function layoutStackedOnMobile(Table $table): Table
1259+
{
1260+
return $this->layoutTable($table)
1261+
->columns([
1262+
TextColumn::make('name')
1263+
->searchable()
1264+
->sortable(),
1265+
TextColumn::make('email'),
1266+
TextColumn::make('phone'),
1267+
TextColumn::make('job'),
1268+
])
1269+
->stackedOnMobile();
1270+
}
1271+
12581272
public function summaries(Table $table): Table
12591273
{
12601274
return $this->postsTable($table)
0 Bytes
Binary file not shown.
9.54 KB
2.39 KB
11.2 KB
2.72 KB
-4.2 KB
-1.19 KB
12.3 KB
1.75 KB

0 commit comments

Comments
 (0)