1. Drag a **Table** component from the right component library to the canvas.
2. Select a data source and create a new query using the query panel at the bottom. This guide uses ToolJet’s sample data source (Postgres). Add the following query to fetch the data from the database:
3. Set the value of the **Data** property of the **Table** component to `{{queries.<query_name>.data}}` to populate the **Table** component with the data retrieved by the query.
3. Navigate to the Pagination section under the table component properties, in the Total record server side enter `{{queries.countOrders.data[0].count}}`. *Note: Make sure to change countOrders with your query name created in the last step.*
6. To disable the next page button on the last page, navigate to the **Table** component properties under the Pagination section. Click on the **fx** icon next to the Enable next page button and enter `{{components.table1.pageIndex<queries.countOrders.data[0].count/100}}` in the field.
7. Go to the Additional Actions section in the Table component's properties. Click the **fx** icon next to the Loading State and enter `{{queries.getOrders.isLoading}}` in the field to add a Loading State. *Note: Make sure to replace getOrders with your query name.*
This is how server side 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.