There are many ways to solve this problem. This one just uses different selectors for each table and paginator you want to use, which we'll then pass into a function that uses them instead of hardcoded values. Other than that, the function behaves almost exactly as the code in the basic example.
By working with a function we can reuse most of our code and better understand what's going.
We can also write the function to use other variables, like perPages
.
That'll be included in this example.
Window | John |
Door | Chris |
Floor | Michael |
Car | James |
Bike | Steven |
0 | 0 |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
6 | 6 |
7 | 7 |
8 | 8 |
9 | 9 |
10 | 10 |
11 | 11 |
12 | 12 |