PHP code example of alonadashko / filament-table-vertical-scroll

1. Go to this page and download the library: Download alonadashko/filament-table-vertical-scroll library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alonadashko / filament-table-vertical-scroll example snippets


use Alonadashko\FilamentTableVerticalScroll\FilamentTableVerticalScrollPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentTableVerticalScrollPlugin::make()
                ->maxHeight('calc(100vh - 16rem)'),
        ]);
}

use Filament\Tables\Table;

public function table(Table $table): Table
{
    return $table
        ->columns([
            // ...
        ])
        ->verticalScrollable();
}

$table->verticalScrollable('400px');
// or
$table->verticalScrollable('50vh');
// or
$table->verticalScrollable('calc(100vh - 12rem)');

// config/filament-table-vertical-scroll.php
return [
    'max_height' => 'calc(100vh - 20rem)',
];