Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

Add CSS class to markdown table

Started by Bruno Gravato 6 years ago · 1 replies · 2983 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, 8 months ago
6 96 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 184 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 147 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 61 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 255 1 year ago