Markdown文本始终左对齐.有没有办法在Markdown中做对齐和对齐?
确切地说,我在Jupyter Notebook(IPython)中使用Markdown .
Nik*_*ath 71
无法在原始降价中对齐文本.但是,您可以使用内联HTML标记对齐文本.
<div style="text-align: right"> your-text-here </div>
Run Code Online (Sandbox Code Playgroud)
为了证明,更换right用justify在上面.
Win*_*oon 12
如果要在表单中右对齐,可以尝试:
| Option | Description |
| ------:| -----------:|
| data | path to data files to supply the data that will be passed into templates. |
| engine | engine to be used for processing templates. Handlebars is the default. |
| ext | extension to be used for dest files. |
Run Code Online (Sandbox Code Playgroud)
https://learn.getgrav.org/content/markdown#right-aligned-text
Giu*_*lio 10
在通用 Markdown 文档中,使用:
<style>body {text-align: right}</style>
或者
<style>body {text-align: justify}</style>
不过似乎不适用于 Jupyter。
如果要在Jupyter Notebook中使用对齐对齐,请使用以下语法:
<p style='text-align: justify;'> Your Text </p>
Run Code Online (Sandbox Code Playgroud)
为了正确对齐:
<p style='text-align: right;'> Your Text </p>
Run Code Online (Sandbox Code Playgroud)
正如这里提到的,markdown 不支持右对齐的文本或块。但是 HTML 结果是通过级联样式表 ( CSS ) 实现的。
在我的 Jekyll 博客上使用的语法也适用于 Markdown。要“终止”一个块,请在末尾使用两个空格或两次新行。
当然,你也可以添加一个 css-class{: .right }代替{: style="text-align: right" }。
文字向右
{: style="text-align: right" }
This text is on the right
Run Code Online (Sandbox Code Playgroud)
文本块
{: style="text-align: justify" }
This text is a block
Run Code Online (Sandbox Code Playgroud)