Data Grids are a great way to display tabulated data.
As with most things in Anvil, the behaviour of search and sort functionality is defined using Python (either in the browser or on the server).
To search, you can add a TextBox and a Button for the user to enter search queries. The Data Grid Searching tutorial that shows how to add a search widget to your Data Grid.
To sort, you can add a Link component to each column header and configure its click handler to run a sort function. Clone this app for an example:
Here is the app running live.