--- id: pagination title: Pagination --- This guide explains how to perform serverside pagination on a **Table** component in ToolJet.
3. Set the value of the **Data** property of the **Table** to `{{queries.
2. Create a new query to find total number of records on server side
```sql
SELECT COUNT(*) FROM public.sample_data_orders
```
3. Navigate to the table's properties under Pagination section, in Total record server side enter `{{queries.countOrders.data[0].count}}`
Make sure to change *countOrders* with your query name create in the last step.
4. Edit the query, as follow:
```sql
SELECT * FROM public.sample_data_orders
LIMIT 100 OFFSET {{(components.table1.pageIndex-1)*100}}
```
**Note**: Make sure to replace *table1* with your **Table** name.
5. Add Event Handler in **Table**:
This will run the query and fetch the data every time the page is changed.
6. Disable the next page button on the last page, navigate to the **Table** properties under Pagination section. Click on the **fx** icon next to Ebable next page button and enter `{{components.table1.pageIndex
This is how serverside pagination is implemented in ToolJet's **Table** component. When pagination is used, the query is executed on the server, retrieving only the relevant set of records for the current page. This ensures that data is fetched efficiently from the server, rather than loading the entire dataset at once, improving performance and scalability.