https://github.com/miranj/craft-sheets-to-tables
A Twig function to convert Spreadsheets into HTML tables
https://github.com/miranj/craft-sheets-to-tables
craft-plugin craft3 craftcms spreadsheet twig twig-filter
Last synced: 5 months ago
JSON representation
A Twig function to convert Spreadsheets into HTML tables
- Host: GitHub
- URL: https://github.com/miranj/craft-sheets-to-tables
- Owner: miranj
- License: mit
- Created: 2018-11-15T11:24:24.000Z (over 7 years ago)
- Default Branch: dev
- Last Pushed: 2024-04-14T13:42:48.000Z (about 2 years ago)
- Last Synced: 2025-10-22T18:02:47.095Z (8 months ago)
- Topics: craft-plugin, craft3, craftcms, spreadsheet, twig, twig-filter
- Language: PHP
- Homepage: https://plugins.craftcms.com/sheets-to-tables
- Size: 15.6 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README

# Sheets to Tables
This [Craft CMS][] plugin adds a [Twig][] function to convert Spreadsheets into HTML tables.
[craft cms]:https://craftcms.com/
[twig]:http://twig.sensiolabs.org/
## Contents
- [Usage](#usage)
- [Installation](#installation)
- [Requirements](#requirements)
- [Changelog](./CHANGELOG.md)
- [License](./LICENSE.md)
## Usage
To convert a spreadsheet file into an HTML ``, pass an [craft\elements\Asset][asset] object as an argument to the `sheetstotables( asset )` Twig function.
[asset]:https://docs.craftcms.com/api/v3/craft-elements-asset.html
```twig
{% set spreadsheet = craft.assets.kind('excel').one() %}
{{ sheetstotables(spreadsheet) }}
```
If the spreadsheet file contains multiple sheets, only the contents of the first sheet will be rendered as a table.
### Supported file formats
- CSV
- Excel (.xlsx, .xls)
- Open Document Format (.ods)
- [Other formats supported by PhpSpreadsheet](https://phpspreadsheet.readthedocs.io/en/develop/)
## Installation
You can install this plugin from the [Plugin Store][ps] or with Composer.
[ps]:https://plugins.craftcms.com/sheets-to-tables
#### From the Plugin Store
Go to the Plugin Store in your project’s Control Panel and search for “Sheets to Tables”.
Then click on the “Install” button in its modal window.
#### Using Composer
Open your terminal and run the following commands:
# go to the project directory
cd /path/to/project
# tell composer to use the plugin
composer require miranj/craft-sheets-to-tables
# tell Craft to install the plugin
./craft plugin/install sheets-to-tables
## Requirements
This plugin requires Craft CMS 3, 4, or 5.
---
Brought to you by [Miranj](https://miranj.in/)