An open API service indexing awesome lists of open source software.

https://github.com/sldeaals/table-pagination-exercise

Simple table pagination exercise
https://github.com/sldeaals/table-pagination-exercise

css-in-js react-hooks react-select react-table reactjs

Last synced: 2 days ago
JSON representation

Simple table pagination exercise

Awesome Lists containing this project

README

          

# table-pagination-exercise

## Instructions
Create a table that implements pagination.
It should have:

1. Three columns. col1, col2, col3.
2. Fourty one rows. The data will be generated by the generateData function. The data should be the same throughout the component lifecycle.
3. Previous button: Should be enabled only if there's previous data available.
4. Next button: Should be enabled only if there's next data available.
5. Records per page selector: Three sizes: 5, 6, 10. When this value changes, go back to the first page by default.
// This function must be used to generate the data
const generateData = (size) => {
const data = [];
for(let i=0; i