1

I am trying to generate tables in reStructuredText. The content is the exported to pdf using rst2pdf. The content is coming from a database that I am parsing. As I don't know the column width in advance I am using the csv-table directive to facilite the table construction.

What I am currently struggling against is how to have cells which content can come on several lines. I tried the usual double quoted cells with a CR/LF but it does not work. Any idea ?

Here is my table with a not working two lines cell ("John, Junior" should come on two lines inside the cell):

.. csv-table:: a title
   :header: "name", "firstname", "age"
   :widths: 20, 20, 10

   "Smith", "John", 40
   "Smith", "John,
   Junior", 20

any idea on how to progress ?

There is a solution proposed when using Sphinx here: csv-table formatting in Python docstrings (Sphinx) - multiple lines in one cell , but I am using rst2pdf where, as far as I can tell, I cannot change the theme as proposed above.

Thanks for your help.

MAC
  • 419
  • 3
  • 9
  • 1
    Possible duplicate of [csv-table formatting in Python docstrings (Sphinx) - multiple lines in one cell](https://stackoverflow.com/questions/34194728/csv-table-formatting-in-python-docstrings-sphinx-multiple-lines-in-one-cell) – Steve Piercy Jun 17 '19 at 19:52
  • 1
    Not exactly duplicate, but indeed I found enough info in this link. Thanks a lot. Here is how it works : use a double CR/LF on the line to cut. – MAC Jun 17 '19 at 20:08
  • 2
    You can answer (and accept) your own question so that others can find the answer if they are looking. This looked unanswered and I nearly didn't click to read – Lorna Mitchell Jul 05 '19 at 08:19

0 Answers0