def paginate(self, klass=Paginator, per_page=None, page=1, *args, **kwargs):

        self.per_page_options = [25, 50, 100, 200]  # This should probably be a passed in option

        self.per_page = per_page = per_page or self._meta.per_page

        self.paginator = klass(self.rows, per_page, *args, **kwargs)
        self.page = self.paginator.page(page)

        # Calc variables for use in displaying first, adjacent, and last page links
        adjacent_pages = 1  # This should probably be a passed in option

        # Starting page (first page between the ellipsis)
        start_page = max(self.page.number - adjacent_pages, 1)
        if start_page <= 3:
            start_page = 1

        # Ending page (last page between the ellipsis)
        end_page = self.page.number + adjacent_pages + 1
        if end_page >= self.paginator.num_pages - 1:
            end_page = self.paginator.num_pages + 1

        # Paging vars used in template
        self.page_numbers = [n for n in range(start_page, end_page) if 0 < n <= self.paginator.num_pages]
        self.show_first = 1 not in self.page_numbers
        self.show_last = self.paginator.num_pages not in self.page_numbers
Paginates the table using a paginator and creates a ``page`` property
dataset/ETHPy150Open fabric-bolt/fabric-bolt/fabric_bolt/core/mixins/tables.py/PaginateTable.paginate