CSV to html – Sticky header (fixed on scroll) and fixed left column

If you want to add a sticky header (when scrolled to top of screen header is fixed to top) to your table, you simply add header_type=”sticky”. If you also want to have fixed left column, you may add fixed_leftcol=”yes”.

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

Sticky header

Just scroll down and see how the header-row of tha table gets stuck on top of the screen.

Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" header_type="sticky"]
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

Sticky header

You may want the header-row to stick a bit down on the page. This could be required if you for example have a fixed header on your site. You simply add table_offset_header and give the intended offset from it’s parent.(If you only have have a table the browser the offset will be from the top position of the browser window).

Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" header_type="sticky" table_offset_header="200px"]
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

Sticky header – change backgroundcolor

The default headerbackgroundcolor is white. If you want to change background of the sticky header, you need to add header_backgroundcolor. This example shows a sticky header with red background color of the header.

Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" header_type="sticky" header_backgroundcolor="#ff0000"]
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

Sticky header with fixed left column- change backgroundcolor

The default background for the fixed left column is white. If you want to change background of this fixed colum n, you need to add header_backgroundcolor_left. This example shows a sticky header with red background color of the header and a black left column. Down below a larger version of previous file is used – just to show it looks when having more data.

Shortcode
[csvtohtml_create source_type="guess" source_files="Free_Test_Data_200KB_CSV-1.csv" header_type="sticky" fixed_leftcol="yes" header_backgroundcolor="#ff0000" header_backgroundcolor_left="#333" include_rows="1-20"]
SR.NAMEGENDERAGEDATE COUNTRY
1Dett2Male1821/05/2015Great 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
10WilloomFemale2715/10/2019France
11WaestonMale2816/08/2018Great Britain
12RosmaFemale2921/05/2017France
13FelisaasMale3021/05/2018France
14DemetasFemale3115/10/2020Great Britain
15JeromywFemale3216/08/2019France
16RashidFemale3321/05/2018France
17DettFemale3421/05/2019United States
18Nern Female3515/10/2021United States
19KallsieFemale3616/08/2020Great Britain
20SiuauFemale3721/05/2019France