# Markdown table with class

**URL:** <https://zola.discourse.group/t/markdown-table-with-class/1459>\
**Category:** Uncategorized\
**Created:** [September 9, 2022, 7:46am UTC](https://zola.discourse.group/t/markdown-table-with-class/1459 "2022-09-09T07:46:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack999](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jack999](https://zola.discourse.group/u/jack999)\
**Post date:** [September 9, 2022, 7:46am UTC](https://zola.discourse.group/t/markdown-table-with-class/1459/1 "2022-09-09T07:46:02Z")

</div>

Hello All

I am coming from Jekyll where one can have a table in markdown and html classes after, like  
| X|Y|  
{: .table }

That is apparently not possible in CommonMark used in Zola.

I have a lot of md with such tables. So my question is: is it possible to have a markdown table with class, or is is necessary to have it in html and import with shortcodes?

best, j

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [September 9, 2022, 8:35am UTC](https://zola.discourse.group/t/markdown-table-with-class/1459/2 "2022-09-09T08:35:08Z")

</div>

Unless [[Feature Request] Allow custom HTML attributes to be inserted from within markdown content · Issue #606 · raphlinus/pulldown-cmark · GitHub](https://github.com/raphlinus/pulldown-cmark/issues/606) is implemented it’s not going to be possible with just Markdown.  
You can embed HTML in markdown directly, no need to have it in a shortcode. You can do something like

```auto
<div class="my-table">
{% table %}
| X|Y|
{% end %}
</div>

```

and have the shortcode render the markdown using the `| markdown` filter

---

<div class="post-metadata">

**Author:** ![jack999](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jack999](https://zola.discourse.group/u/jack999)\
**Post date:** [September 9, 2022, 9:08am UTC](https://zola.discourse.group/t/markdown-table-with-class/1459/3 "2022-09-09T09:08:20Z")

</div>

Thanks @keats for confirming what I feared.

yes, I had seen that GitHub request.

It is sad, and embedding a html table is super clumsy.

That said, a very clumsy workaround (but easy to code) is to have md in separate folder and have python automatically convert the md table to html with class and copy all to zola contents. Can even do that with life editing and fswatch. elegant it isnt.

all the best,

p.s. I got one site mostly done in zola and have 3 jekyll conversions to go. I think you have made the perfect ssg.

j
