How to Add Row Index / Serial Number in Filament Table

In this guide, we will see how we can add row index in filament table.

Table of Contents

Problem

By default, Filament tables do not show row numbers.
In many admin panels, users expect to see a serial number / index column (1, 2, 3…) for better readability.

Solution

You can easily add an index column using Filament’s TextColumn and the $loop index.

use Filament\Tables\Columns\TextColumn;

TextColumn::make('index')
->label('#')
->rowIndex(),

Leave a Reply

Your email address will not be published. Required fields are marked *