Search code examples
restructuredtext

Multiple lines of text in single cell of simple table?


I found this question, but I don't want explicit <br>s in my cell; I just want it to line-wrap where necessary.

e.g.,

================  ============
a short sentence  second cell
a much longer     bottom right
  sentence
================  ============

I want "a much longer sentence" to all fit in one cell. I'd need to use very long lines of text unless I can find a way to wrap it. Is this possible?

I'm using ~NoTex~ w/ PDF output if relevant.


Solution

  • The simple table style does not support wrapping blocks. Use the grid style instead, like this:

    +------------------+--------------+
    | a short sentence | second cell  |
    +------------------+--------------+
    | a much longer    | bottom right |
    | sentence         |              |
    +------------------+--------------+
    

    These tables are more tedious to work with, but they're more flexible. See the full documentation for details.