Detailed use of markdown form

MARKDOWN form

table of Contents

  1. Markdown form writing
  2. markdown table alignment
  3. Line break in markdown table
  4. markdown form hyperlink
  5. markdown inter-row form
  6. Markdown table background color

Markdown form writing

Markdown makes tables use | to separate different cells, and-to separate table headers and other rows.

|1   |2  |
|  -- | --  |
| 单元格  | 单元格 |
| 单元格  | 单元格 |

Show results

Column 1 Column 2
Cell Cell
Cell Cell

markdown alignment

Alignment: use the English ":" symbol

|  左对齐   |  居中  |  右对齐 | 
|  :-- | :--:  | --:|
| 你好  | こんにちは| hello|
| 你好  | こんにちは| hello|

Show results

Align left Centered Align right
Hello there Hello hello
Hello there Hello hello

Line break in markdown table

Line wrapping: use the <br> tag in html

|  作者  |  诗名  |  诗文 |
|  -- | --  | :--: |
| 李商隐  | 锦瑟 | 锦瑟无端五十弦,一弦一柱思华年。<br>庄生晓梦迷蝴蝶,望帝春心托杜鹃。<br>沧海月明珠有泪,蓝田日暖玉生烟。<br>此情可待成追忆?只是当时已惘然。|
| 李白  | 将进酒 | 人生得意须尽欢,莫使金樽空对月。<br>天生我材必有用,千金散尽还复来。|

Show results

Author Poem title Poetry
Li Shangyin Jinse Jinse has fifty strings for no reason, one string and one column think of Huanian.
Zhuang Shengxiao dreams of butterflies, and Wang Dichun cares for the cuckoo.
There are tears in the moon pearl in the sea, and the jade in Lantian is warm in the sun and smoke.
Can this be a memory? It's just that I was at a loss.
Li Bai Will enter the wine You must be happy in life, don't make Jinzun empty to the moon.
I am born to be useful, and come back when my wealth is gone.

Hyperlink in markdown form

|1   | 
|  -- |
| 传送门: [本文]() |

Show results

Portal
This article

markdown inter-row form

<table>
    <tr>
        <th rowspan="3">我占了三行</th>
        <th>第一列</th>
        <th>第二列</th>
    </tr>
    <tr>
        <td>第一列</td>
        <td>第二列</td>
    </tr>
    <tr>
        <td>第一列</td>
        <td>第二列</td>
    </tr>
</table>  

Show results

I accounted for three lines first row the second list Third column
first row the second list Third column
first row the second list Third column

Markdown table background color

<table>
        <th>方法说明</th><th>颜色名称</th><th>颜色</th>
    </tr>
    <tr>
        <td><font color="Hotpink">此处实现方法利用 CSDN-markdown 内嵌 html 语言的优势</font></td><td><font color="Hotpink">Hotpink</font></td><td bgcolor="Hotpink">rgb(240, 248, 255)</td>
    </tr>
    <tr>
        <td><font color="Pink">借助 table, tr, td 等表格标签的 bgcolor 属性实现背景色设置</font></td><td><font color="pink">AntiqueWhite</font></td><td bgcolor="Pink">rgb(255, 192, 203)</td>
    </tr>
</table>

Show results

Method description Color name colour
The implementation method here takes advantage of the embedded html language in CSDN-markdown Hotpink rgb(240, 248, 255)
Set the background color with the help of the bgcolor attribute of table tags such as table, tr, td, etc. AntiqueWhite rgb(255, 192, 203)

Reference URL

  1. Markdown table—merge cells—set cell color
  2. Markdown table style settings (inter-row table, background color, etc.)

Guess you like

Origin blog.csdn.net/dbc_zt/article/details/112605291