CSV to html – Fixed header and columns

If you want to add a fixed header you need to add an attribute header_type=”fixed”. For this to have any visual effect you need to have a fixed height (table_height).

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

Fixed header

Scroll up and down in the table below you would see that the header -row is fixed. If you don’t specify any value for the table height it would be in pixels (so table height below is 400 pixels). Possible values for table_height are %, vh, px, em, rem.

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

Fixed left column

If you want to combine fixed headers with a fixed left column you could also set fixed_leftcol to yes. It’s also possible to define a table width with table_width (else it would not make sense with fixed left column). Possible values for table_width are %, vw, px, em, rem. You need to set the table width smaller than it’s parent else it would not be horisontal scroll and then there would be no need for fixed left column.

Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" header_type="fixed" fixed_leftcol="yes" table_height="400" table_width="50%" header_backgroundcolor_left="blue"]
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