Skip to content

Commit 3a04d51

Browse files
authored
Add Vertical Scrolling Example (rappasoft#1926)
1 parent a7b1f68 commit 3a04d51

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/datatable/styling.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,3 +386,21 @@ public function configure(): void
386386
]);
387387
}
388388
```
389+
390+
### Vertical Scrolling Example
391+
Should you wish to implement a table with a responsive height, and vertical scrolling for additional rows, a basic example is below that demonstrates the approach, noting that you will likely wish to adjust the break-points!
392+
393+
```php
394+
public function configure(): void
395+
{
396+
397+
$this->setTableWrapperAttributes([
398+
'class' => 'max-h-56 md:max-h-72 lg:max-h-96 overflow-y-scroll',
399+
]);
400+
$this->setTheadAttributes([
401+
'class' => 'sticky top-0 '
402+
]);
403+
}
404+
```
405+
406+
Keep in mind that you must only call methods from configure() once to avoid overriding or conflicting results.

0 commit comments

Comments
 (0)