gpt4 book ai didi

python - reStructuredText:如何在表格中使用续行?

转载 作者:行者123 更新时间:2023-11-28 20:47:52 25 4
gpt4 key购买 nike

我在 reStructuredText 中有以下整洁的小表格:

======   =======   ======  =====================
Symbol Meaning Type Example
====== ======= ====== =====================
G Era Text "GG" -> "AD"
y Year Number "yy" -> "03"
"yyyy" -> "2003"
M Month Text "M" -> "7"
or "M" -> "12"
Number "MM" -> "07"
"MMM" -> "Jul"
"MMMM" -> "December"
====== ======= ====== =====================

根据 Docutils documentation on simple tables我希望 Spinx 生成的结果 HTML 表格与文本中的布局相同,因此“yy”和“yyyy”将位于不同的行,“M”、“MM”等也是如此。然而结果是这样的:

HTML table example generated by Sphinx. Contains Date format strings.

我尝试了一些替代方法,例如在最后一列的开头使用竖线 (|)、空行、缩进。我最接近的是在“yyyy”之前使用缩进。然后“yyyy”在下一行,但它是缩进的。当然,我希望它与“yy”具有相同的缩进级别。

最佳答案

您需要的是 line block :

======   =======   ======  =====================
Symbol Meaning Type Example
====== ======= ====== =====================
G Era Text "GG" -> "AD"
y Year Number | "yy" -> "03"
| "yyyy" -> "2003"
M Month Text | "M" -> "7"
or | "M" -> "12"
Number | "MM" -> "07"
| "MMM" -> "Jul"
| "MMMM" -> "December"
====== ======= ====== =====================

示例输出:

RestructuredText Table with Line blocks

(source)

关于python - reStructuredText:如何在表格中使用续行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17928572/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com