Sticky Columns and Header
Inertia Table supports sticky columns and a sticky header. This feature is useful when you have a large table and you want to keep the header and some columns visible while scrolling.
Sticky Header
To make the header sticky, set the $stickyHeader property to true in your table class.
php
use InertiaUI\Table\Table;
class Users extends Table
{
protected ?bool $stickyHeader = true;
}To make the header sticky for all tables by default, you may call the static defaultStickyHeader() method on the Table class, for example, in your AppServiceProvider:
php
use InertiaUI\Table\Table;
Table::defaultStickyHeader();Sticky Columns
To make a column stickable, you may use the stickable argument in the make() method or by using the stickable() method.
php
TextColumn::make('name', stickable: true);
TextColumn::make('name')->stickable();To make all columns stickable by default, you may call the static defaultStickable() method on the Column class, for example, in your AppServiceProvider:
php
use InertiaUI\Table\Columns\Column;
Column::defaultStickable();