Pagination
Introduction
By default, all Tables are paginated and the user can select how many rows to display per page. The pagination controls are displayed at the bottom of the table. The default options are 15
, 30
, 50
, and 100
rows per page, and 15
rows per page is selected by default.
Per Page Options
You can customize the pagination options by setting the $perPageOptions
property in your Table class:
php
class Users extends Table
{
protected ?array $perPageOptions = [50, 100, 250];
}
If you want this to be the default for all tables, you may call the static defaultPerPageOptions()
method on the Table class, for example, in your AppServiceProvider
:
php
use InertiaUI\Table\Table;
Table::defaultPerPageOptions([50, 100, 250]);
Disable Pagination
Though absolutely not recommended, you can disable pagination by setting the $pagination
property to false
:
php
class Users extends Table
{
protected bool $pagination = false;
}