Here is a link to my Elements Project that I thought I would share, that demonstrates accessing data from a CSV file to populate an HTML Custom Component table: Test_7_Seven_PHP_CSV
It only works as a published website. I am using MAMP PRO to test it as it won’t work correctly in preview (as previously mentioned). In addition, because it is using PHP, the WYSIWYG editor can’t display the output although you do get a view of what the Custom HTML Component property options alter:
You can configure the formatting of the table cell entries and any error message. The most important property is the CSV filename in order to select the csv data to display.
This is the folder structure of the locally published project:
You need to create one or more data files that you place in a data directory (see folder structure above). I created empty name_1.csv and name_2.csv files, in order to test a csv file with no content. I then created two more files to contain a list of names as follows, to use on the two web pages:
names_1.csv
John,Smith
Emma,Johnson
Michael,Williams
Sophia,Brown
David,Jones
Olivia,Garcia
James,Miller
Ava,Davis
Robert,Rodriguez
Isabella,Martinez
names_2.csv
Liam,Wilson
Sophia,Clark
Noah,Walker
Olivia,Hall
Ethan,Young
Ava,Allen
Mason,King
Isabella,Wright
William,Scott
Charlotte,Green
James,Baker
Amelia,Nelson
Benjamin,Carter
Mia,Mitchell
Elijah,Perez
Harper,Roberts
Lucas,Turner
Evelyn,Phillips
Henry,Campbell
Abigail,Parker
You can preview the project but you will get a missing file error.
It is fairly basic but gives an idea how you can access CSV data by using a combination of Elements and PHP.
The ouput should look like this: