Default Table

We are now ready to render the table, and it's a cinch!

Go to the twig file where you would like to embed the table and add the following line at the very beginning:

{% do view.registerAssetBundle('matfish\\Tablecloth\\TableclothAssetBundle') %}    

This will import the required assets:

  • AlpineJS v3.7.1

  • Tablecloth JavaScript file

  • Tablecloth CSS file

Now, all that's left is to embed the table wherever it should go in your page. You can have multiple tables on the same page. Assuming the table handle is posts (see Data Source page) we will render it like so:

{{ tablecloth('posts') | raw }}

Load the page in the browser to see the result:

Last updated