Simple Responsive Tables Plugin
The Simple Responsive Tables Plugin is for Grav CMS. It wraps tables in a div, enabling them to be scrolled vertically on small screens.
<table> HTML outputs:
<table> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> </table>
<div> elements, like this:
<div class="simple-responsive-table"> <div> <table> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> </table> </div> </div>
Installing the Simple Responsive Tables plugin can be done in one of two ways. The GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file.
GPM Installation (Preferred)
The simplest way to install this plugin is via the Grav Package Manager (GPM) through your system's terminal (also called the command line). From the root of your Grav install type:
bin/gpm install simple-responsive-tables
This will install the Simple Responsive Tables plugin into your
/user/plugins directory within Grav. Its files can be found under
To install this plugin, just download the zip version of this repository and unzip it under
/your/site/grav/user/plugins. Then, rename the folder to
simple-responsive-tables. You can find these files on GitHub or via GetGrav.org.
You should now have all the plugin files under
Before configuring this plugin, you should copy the
user/config/plugins/simple-responsive-tables.yaml and only edit that copy.
Here is the default configuration and an explanation of available options:
enabled: true # Set to false to disable this plugin completely active: false # Option to (de-)activate this plugin on a page
After installing and enabling the plugin, it is deactivated by default.
You now can activate it on a page per page basis by setting the
true in the frontmatter:
simple-responsive-tables: active: true
If you do have a lot of pages with tables you can enable the plugin for the entire site, by setting the
active flag to
It is also possible to deactivate the functionality on certain pages, by setting the config to
false again in the frontmatter.
The plugin is inspired and based on the following works: