# Table

> Learn to define InertiaX tables in Laravel and render them with Inertia and React, from your first table to filters and custom cells.

Source: https://docs.inertiax.dev/table/

InertiaX adds searchable, sortable, filterable tables to your Laravel + Inertia + React application. Define the data and columns in PHP, then render the table by name in React.

Laravel queries the data. InertiaX supplies the table UI and keeps its controls, URL state, and results in sync through Inertia partial reloads. Links to records and operations on selected rows stay in your application’s routes; see the [recipes](https://docs.inertiax.dev/table/examples/).

## A table in two parts

Return a table as an Inertia prop:

**Laravel**

```php
use Inertia\Inertia;
use InertiaX\Table\Columns\NumberColumn;
use InertiaX\Table\Columns\TextColumn;
use InertiaX\Table\Table;

return Inertia::render('users/index', [
    Table::make('users')
        ->data($users)
        ->addColumns([
            NumberColumn::make('id')->numberCast('int'),
            TextColumn::make('name')->searchable()->sortable(),
        ]),
]);
```

Here, `$users` is the Eloquent query for the records your page displays. Render the prop by its name:

**React**

```tsx
import { AppTable } from '@/components/app-table';

export default function UsersIndex() {
    return <AppTable prop="users" />;
}
```

You can keep a small definition inline, move it into a reusable table class, or [let InertiaX infer the columns and filters](https://docs.inertiax.dev/table/quick-start/#or-let-inertiax-infer-the-columns-and-filters) from your model. Add filters, selection, and custom cell rendering as you need them.

## Where to go next

New here? Start with [Installation](https://docs.inertiax.dev/table/installation/), then [Your first table](https://docs.inertiax.dev/table/quick-start/). Already have a table? Go straight to [Columns](https://docs.inertiax.dev/table/guide/columns/), [Search](https://docs.inertiax.dev/table/guide/search/), or [Filtering](https://docs.inertiax.dev/table/guide/filters/). [Recipes](https://docs.inertiax.dev/table/examples/) lists common tasks with the guide page for each.

Building a table with an AI agent? The [agent guide](https://docs.inertiax.dev/table/agent-guide/) covers setup, a complete table, its page and a feature test, for an existing app with package access.

Not using Inertia? See [Direct envelope](https://docs.inertiax.dev/table/guide/direct-rendering/). The table shows the response you supply, and fetching new rows is up to your own integration.
