CSV to html – pagination

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.NAMEGENDERAGEDATE COUNTRY
1Dett2Female3616/08/2020Great Britain
2Nern Female1915/10/2017France
3KallsieMale2016/08/2016France
4SiuauFemale2121/05/2015Great Britain
5ShenniceMale2221/05/2016France
6ChasseFemale2315/10/2018France
7TommyeMale2416/08/2017United States
8DorcastFemale2521/05/2016United States
9AngeleeMale2621/05/2017Great Britain
10WilloomFemale2615/10/2019France

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.NAMEGENDERAGEDATE COUNTRY
6ChasseFemale2315/10/2018France
7TommyeMale2416/08/2017United States
8DorcastFemale2521/05/2016United States
9AngeleeMale2621/05/2017Great Britain
10WilloomFemale2615/10/2019France

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.NAMEGENDERAGEDATE COUNTRY
6ChasseFemale2315/10/2018France
7TommyeMale2416/08/2017United States
8DorcastFemale2521/05/2016United States

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.NAMEGENDERAGEDATE COUNTRY
6ChasseFemale2315/10/2018France
7TommyeMale2416/08/2017United States
8DorcastFemale2521/05/2016United States

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.NAMEGENDERAGEDATE COUNTRY
6ChasseFemale2315/10/2018France
7TommyeMale2416/08/2017United States
8DorcastFemale2521/05/2016United States