bluegg / csvtotable
Create a table from a CSV
Installs: 32
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:craft-plugin
Requires
- craftcms/cms: ^5
- phpoffice/phpspreadsheet: ^1.23
README
Create a table from a CSV
Requirements
This plugin requires Craft CMS 5 or later.
Installation
To install the plugin, follow these instructions.
- Open your terminal and go to your Craft project:
cd /path/to/project/craft
- Then tell Composer to load the plugin:
composer require towardstudio/csvtotable
- In the Control Panel, go to Settings → Plugins and click the “Install” button for CSV to Table.
Settings
In a Dev environment there is a control panel navigation item which will direct you to the plugin settings.
Within the settings you can set classes on each of the table elements to give a global style.
Template
{{ csvToTable(entry.csvTable) }}
To display the table, you can pass the Asset into a function. This will automatically change the data into a table format.
Additional Parameter
If you don't want your table to display with a <thead>
you can pass an additional parameter of false
into the function which will remove the <thead>
option.
{{ csvToTable(entry.csvTable, false) }}
Brought to you by Toward