When dealing with large csv-files it could be a good idea to use pagination. Pagination links are shown below table as default. When clicking on first,prev,next or last you see new content in the table without the need of reloading the page.
Original
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
1 | Dett2 | Female | 36 | 16/08/2020 | Great Britain |
2 | Nern | Female | 19 | 15/10/2017 | France |
3 | Kallsie | Male | 20 | 16/08/2016 | France |
4 | Siuau | Female | 21 | 21/05/2015 | Great Britain |
5 | Shennice | Male | 22 | 21/05/2016 | France |
6 | Chasse | Female | 23 | 15/10/2018 | France |
7 | Tommye | Male | 24 | 16/08/2017 | United States |
8 | Dorcast | Female | 25 | 21/05/2016 | United States |
9 | Angelee | Male | 26 | 21/05/2017 | Great Britain |
10 | Willoom | Female | 26 | 15/10/2019 | France |
Pagination
If you want pagination, the only thing you need to do is to add pagination=”yes” to your shortcode. IF you have more than 10 rows in your table, then different links will show that makes it possible for the visitor to navigate in your tabledata.
In this case below there are only 10 rows in total and therefore no links are shown.
Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" pagination="yes"]
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
1 | Dett2 | Female | 36 | 16/08/2020 | Great Britain |
2 | Nern | Female | 19 | 15/10/2017 | France |
3 | Kallsie | Male | 20 | 16/08/2016 | France |
4 | Siuau | Female | 21 | 21/05/2015 | Great Britain |
5 | Shennice | Male | 22 | 21/05/2016 | France |
6 | Chasse | Female | 23 | 15/10/2018 | France |
7 | Tommye | Male | 24 | 16/08/2017 | United States |
8 | Dorcast | Female | 25 | 21/05/2016 | United States |
9 | Angelee | Male | 26 | 21/05/2017 | Great Britain |
10 | Willoom | Female | 26 | 15/10/2019 | France |
You may define number of rows you want on each page of the pagination with pagination_rows. Default is 10 but you can change this by adding pagination_rows with given number, e.g. pagination_rows=”3″.
Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" pagination_rows="3" pagination="yes"]
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
1 | Dett2 | Female | 36 | 16/08/2020 | Great Britain |
2 | Nern | Female | 19 | 15/10/2017 | France |
3 | Kallsie | Male | 20 | 16/08/2016 | France |
As default pagination links are shown below table, but you could decide to show these links above table, below table or both by setting pagination_above_table and/or pagination_below_table (default is yes) to yes or no.
Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" pagination_above_table="yes" pagination_below_table="no" pagination_rows="3" pagination="yes"]
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
1 | Dett2 | Female | 36 | 16/08/2020 | Great Britain |
2 | Nern | Female | 19 | 15/10/2017 | France |
3 | Kallsie | Male | 20 | 16/08/2016 | France |
If you want to change text of the pagination links, you could use pagination_text_start, pagination_text_prev, pagination_text_next or pagination_text_last for this:
Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" pagination_text_prev="Previous page" pagination_text_next="Next page" pagination_rows="3" pagination="yes"]
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
1 | Dett2 | Female | 36 | 16/08/2020 | Great Britain |
2 | Nern | Female | 19 | 15/10/2017 | France |
3 | Kallsie | Male | 20 | 16/08/2016 | France |