# CSS para tablas individuales en una publicación

**URL:** <https://meta.discourse.org/t/css-for-individual-tables-in-a-post/87284>\
**Category:** Development\
**Tags:** css\
**Created:** [11 Mayo, 2018 18:01 UTC](https://meta.discourse.org/t/css-for-individual-tables-in-a-post/87284 "2018-05-11T18:01:20Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)\
**Post date:** [14 Mayo, 2018 01:55 UTC](https://meta.discourse.org/t/css-for-individual-tables-in-a-post/87284/7 "2018-05-14T01:55:59Z")

</div>

If you’re on a recent version of Discourse - as this is a recent change - you can also use `data-theme` attributes.

For example:

```plaintext
<div data-theme-table="fixed">
	
	<table>
		<thead>
			<tr>
				<th>Col A</th>
				<th>Col B</th>
				<th>Col C</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>A1</td>
				<td>B1</td>
				<td>C1</td>
			</tr>
		</tbody>
	</table>
	
</div>

```

Or with markdown

```plaintext
<div data-theme-table="fixed">

| Col A | Col B | Col C|
|---|---|---|
| A1 | B1 | C1 |

</div>

```

Would look like this:

| Col A | Col B | Col C |
| --- | --- | --- |
| A1 | B1 | C1 |

No difference visually - but can be targeted with CSS like this:

```plaintext
[data-theme-table="fixed"] table {
    background: red;
}

```

The result is a red background for tables inside divs with the attribute `data-theme-table="fixed"` but no effect on other tables.

![Capture18](https://global.discourse-cdn.com/meta/original/3X/2/2/22bbf92e128a6b207520ef90df8b889e29e2917f.PNG)

So all you need to do is define the CSS once and then use the attributes in posts where you want the styles to apply.

---

_[View the full topic](https://meta.discourse.org/t/css-for-individual-tables-in-a-post/87284)._
