Markdown 是否在标记表中左对齐标题?

Markdown 是否在标记表中左对齐标题?,markdown,github-flavored-markdown,Markdown,Github Flavored Markdown,使用GitHub上“”中的表示例,可以得到以下结果: | Tables | Are | Cool | | ------------- |:-------------:| -----:| | col 3 is | right-aligned | $1600 | | col 2 is | centered | $12 | | zebra stripes | are neat | $1 | 我的问题是,有没有办法

使用GitHub上“”中的表示例,可以得到以下结果:

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |


我的问题是,有没有办法将标题单元格左对齐?

这取决于您使用的实现

表是降价的非标准特性,支持表的每个实现都有不同的降价特性。例如,问题中提到的“奶酪单”就在项目中。该项目的自述包括以下说明:

要了解在此处的Markdown中可以使用Markdown做什么,请查看和其他

因此,“cheetsheet”是特定于Markdown在此使用的实现的

GitHub将其Markdown实现作为Commonmark规范的一部分(是一个不支持表的Markdown变体)。根据,列标题接收与列单元格相同的对齐方式:

| abc | defghi|
:-: | -----------:
巴兹
abc
德夫吉
酒吧
巴兹

因此,您需要检查正在使用的标记的具体实现,并阅读该实现的文档。然而,就我个人而言,我从来没有遇到过一个实现,它允许您为标题和单元格定义单独的对齐方式。根据我的经验,要么得到与单元格匹配的标题,要么得到没有指定对齐方式的标题。

在第二行,我将更改为将所有内容(标题和内容)向左对齐:

| :------------ | :-------------- | :----- |
注意每列左边的冒号

| Tables        | Are           | Cool  |
|:------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| col 1 is      | left-aligned  |   $42 |
| zebra stripes | are neat      |    $1 |
请注意,第二行的冒号(“:”)和第二个字符是用来 另一个选项是将数字移动到最左边的列(如下所示)

试穿一下

把----行放在页眉上方似乎不起作用

| Tables        | Are           | Cool  |
|:------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| col 1 is      | left-aligned  |   $42 |
| zebra stripes | are neat      |    $1 |
Amount | Items
------:|:-----
    20 | Wooden Boards
     5 | Old Parts