如何避免 ReST 表中的水平滚动条? [英] How can I avoid the horizontal scrollbar in a ReST table?
本文介绍了如何避免 ReST 表中的水平滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 ReST 标记中有这个表:
I have this table in ReST markup:
+---------------------------+-----------------------------------------------------------------+
| Option Line Kind | Distinguishing Characteristic |
+===========================+=================================================================+
| **Reference** | The option name is called a (node) reference, if the value\ |
| | of an option is a predefined keyword for the current node\ |
| | class. Because the option's value is a keyword, it can not\ |
| | be an interpolated value. |
+---------------------------+-----------------------------------------------------------------+
| **Option** | The option uses a defined option name valid for the current\ |
| | node class. The value can be a fixed or interpolated string. |
+---------------------------+-----------------------------------------------------------------+
| **User Defined Variable** | Otherwise an option line is a user defined variable. It can\ |
| | have fixed or interpolated string values. |
+---------------------------+-----------------------------------------------------------------+
Sphinx(ReadTheDocs 主题)生成一个水平滚动条而不是破坏第 2 列中的内容.结果是这样的:
Sphinx (ReadTheDocs theme) generates a horizontal scrollbar instead of breaking the content in column 2. The result is this mess:
我需要在 ReST(或 RTFD 主题??)中更改什么才能让它打破文本?
What do I need to change in ReST (or the RTFD theme??) to let it break the text?
@aflp91 的回答结果如下表:
The answer from @aflp91 results in this table:
推荐答案
添加一个 _static/custom.css 文件
Add a _static/custom.css file with
.wy-table-responsive table td {
white-space: normal;
}
不要忘记在 conf.py 中声明:
Don't forget to declare it into conf.py:
def setup(app):
app.add_stylesheet('custom.css')
在我的测试中有效...
Works in my test…
这篇关于如何避免 ReST 表中的水平滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文