# How to add a class attribute to a table created using markdown

**URL:** https://meta.discourse.org/t/how-to-add-a-class-attribute-to-a-table-created-using-markdown/84338
**Category:** Support
**Created:** [April 1, 2018, 6:04pm UTC](https://meta.discourse.org/t/how-to-add-a-class-attribute-to-a-table-created-using-markdown/84338 "2018-04-01T18:04:14Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 1, 2018, 7:23pm UTC](https://meta.discourse.org/t/how-to-add-a-class-attribute-to-a-table-created-using-markdown/84338/4 "2018-04-01T19:23:21Z")

</div>

`[data-theme-*]` attributes are whitelisted inside post content, so you can do

```html
<div data-theme-shortcuts="true">

</div>

```

and then target it in CSS using something like

```css
div[data-theme-shortcuts="true"] {

}

```

Originally discussed here:

> [@How can I whitelist a class in a theme?](https://meta.discourse.org/t/how-can-i-whitelist-a-class-in-a-theme/79520/):
>
> I have a working carousel which I would like to package as a theme: [image] I’ve been trying to figure out how to whitelist a class or attribute for the script to target that would work with under a theme. I’ve read: [https://meta.discourse.org/t/whitelisting-some-html-tags/24280](https://meta.discourse.org/t/whitelisting-some-html-tags/24280) and [Whitelist all the code inside of a div tag?](https://meta.discourse.org/t/whitelist-all-the-code-inside-of-a-div-tag/51391/4) But these topics cover plugin structure and I could not get any of the methods to work in a theme. I’ve used the [dir] attribute - white-listed by default - in anot…

---

_[View the full topic](https://meta.discourse.org/t/how-to-add-a-class-attribute-to-a-table-created-using-markdown/84338)._
