CSV to html – search highlighted

Search

It’s easy to implement basic search functionality. The search functionality search through the table with a a wildcard-filter in each visible column.

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

Highlight search results

To give feedback to the user why the results are shown based on your search, you can use search_highlight=”yes”. The default highlightcolor is yellow.

[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" search_functionality="yes" search_highlight="yes"]
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

If you do the search now with the value 9 you will see this data:

SR.NAMEGENDERAGEDATE COUNTRY
2Nern Female1915/10/2017France
9AngeleeMale2621/05/2017Great Britain
10WilloomFemale2615/10/2019France

To change the highlighted color you simply add search_highlightcolor with the color you want.

[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" search_functionality="yes" search_highlightcolor ="lightgreen"]
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

And the result would be:

SR.NAMEGENDERAGEDATE COUNTRY
2Nern Female1915/10/2017France
9AngeleeMale2621/05/2017Great Britain
10WilloomFemale2615/10/2019France