MARKDOWN文档中可以通过“|”分隔多行字符的语法来定义二维的表格。表格的每一栏的宽度是由MARKDOWN自行根据显示的内容进行调整的。
下面给出了对应的一个示例:
示例:表格示例
Name | Value
-------|-------------------
`Value-One` | Long explanation
`Value-Two` | Long explanation
`etc` | Long explanation
Name | Value |
---|---|
Value-One | Long explanation |
Value-Two | Long explanation |
etc | Long explanation |
现在出现一个问题: 如何调整表格的每一栏的宽度呢?
在博文 Set table column width via Markdown 中,给出了在MARKDOWN中设置表格的多个方法。
1.在表格头中增加空白长度
Name | Value
-------|-------------------
`Value-One` | Long explanation
`Value-Two` | Long explanation
`etc` | Long explanation
Name | Value |
---|---|
Value-One | Long explanation |
Value-Two | Long explanation |
etc | Long explanation |
下面的表格使用&emsp替代 ,&emsp 相当于四个 。
Name | Value |
---|---|
Value-One | Long explanation |
Value-Two | Long explanation |
etc | Long explanation |
2.使用标志
name<img width=200/>|<img width=100/>value
-|-
window|hello|
name | |
---|---|
window | hello |
3.使用div标志
| <div style="width:290px">property</div> | description |
| --------------------------------------- | ------------------------------------- |
| `border-bottom-right-radius` | Defines the shape of the bottom-right |
property
| description |
---|---|
border-bottom-right-radius | Defines the shape of the bottom-right |