How to prevent or disable 'Next' button at the end of a DataTable?


At the end of a DataTable with pagination, the ‘Next’ button can continue paginating even though there are no more content or rows to be displayed.

How can we prevent this?

I’m currently using the same code from the documentation and notice that even in the documentation example, ‘Next’ can be pressed at the end infinitely.

Code snippet:

return dff.iloc[
    page_current*page_size:(page_current+ 1)*page_size

Screenshots from documentation:

At the end of table:

Pressing ‘Next’:

Appreciate any insights, thanks!