How can I avoid the horizontal scrollbar in a ReST table?

空扰寡人 提交于 2019-12-12 05:09:34

问题


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 theme) generates a horizontal scrollbar instead of breaking the content in column 2. The result is this mess:

What do I need to change in ReST (or the RTFD theme??) to let it break the text?


Edit:

The answer from @aflp91 results in this table:


回答1:


Add a _static/custom.css file with

.wy-table-responsive table td {
white-space: normal;
}

Don't forget to declare it into conf.py:

def setup(app):
app.add_stylesheet('custom.css')

Works in my test…




回答2:


You can use CSS property for table:

Overflow-x : hidden;
overflow-y : hidden;


来源:https://stackoverflow.com/questions/40641252/how-can-i-avoid-the-horizontal-scrollbar-in-a-rest-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!