How do you right align text in Jekyll?
I have a block of text I want to right align.
If it was HTML, I'd do something like:
style="text-align:right;"
How can I do that in Markdown with Jekyll?
How do you right align text in Jekyll?
I have a block of text I want to right align.
If it was HTML, I'd do something like:
style="text-align:right;"
How can I do that in Markdown with Jekyll?
Jekyll 2.0+ uses kramdown as a default markdown converter.
You can declare right align in your css:
.right{
text-align: right;
}
Then, simply add after your paragraph:
This text is right aligned. {: .right}
You will have to use HTML tags for that, e.g. <p style="text-align: right">
. Markdown can align table contents by putting a colon in the separator line (left, right, both ends), but not normal text, AFAIK.
Jekyll supports Textile language, so you can use the specific tags for paragraphs, in your case the tag to align on the right p>.
.
In the linked page:
p>. Aligned right paragraph.
As we known, Jekyll uses kramdown as a default markdown converter from 2.0+. And It doesn't support the table text alignment now, I think the below can help you.
1. The first solution is HTML and CSS (for normal block alignment):
a. using inline style:
<p style="text-align: right">Your awesome text</p>
b. using outer style:
.right {
text-align: right;
}
and
<p class="right">Your awesome text</p>
or
Your awesome text. {: .right}
2. The second solution is Jekyll Plugin (for table alignment):
jekyll-spaceship - A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, emoji, youtube, dailymotion, vimeo, etc.
https://github.com/jeffreytse/jekyll-spaceship
For now, these extended features are provided:
- Cells spanning multiple columns
- Cells spanning multiple rows
- Cells text align separately
- Table header not required
- Grouped table header rows or data rows