Skip to content
● Critical PHP security fixes are out: update PHP on your Grav sites. What to do →

Add CSS class to markdown table

Started by Bruno Gravato 6 years ago · 1 replies · 3414 views
6 years ago

According to this old post: Markdown extra not work, there's no way to add a class to a table... is this still true? And is the solution offered there still the best one?

Quoting:

@hugoaf:
AFAIK there is no way to add a class to a table in markdown extra.
One possible alternative is to wrap your table in a div

HTML
<div class="divtable" markdown="1"> 

First Header  | Second Header
------------- | -------------
Content Cell  | Content Cell
Content Cell  | Content Cell

 </div>

then use the .divtable table { } selector.

Thanks.

6 years ago

True.

Wrapping the element with class is the quickest, and sometimes render a markdown extra to be useless.

Unless you want to write your own markdown

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 12 months ago
6 1285 12 months ago
Content & Markdown · by Ton Haarmans, 2 years ago
10 1015 1 year ago
Content & Markdown · by Jan L'Am, 2 years ago
4 890 2 years ago
Content & Markdown · by Leonardo, 2 years ago
3 815 2 years ago
Content & Markdown · by belthasar, 2 years ago
4 1233 2 years ago