Skip to content Skip to sidebar Skip to footer

Can Multiple Paragraphs Be Substituted Into Restructuredtext Table Cells?

I have a reST formatted table where some cells contain long blocks of text (i.e. multiple paragraphs or bulleted lists) and they get updated periodically, for example: +-------+---

Solution 1:

The following example works for me. Note that whitespace is super tricky. I always use 4 spaces when indenting anything, including options such as :header:, because it makes it easier to detect issues and it ensures that whitespace is interpreted correctly by Sphinx. In your example, all you needed to do was add one more space before :header: for a total of 4 spaces to get everything aligned. I've also added an example of an enumerated list.

.. csv-table:: Test csv-table with multi-paragraph
    :header: "a", "b", "c"

    Cat,"Chunk that is updated periodically via copy-and-paste.

    Line #2, #3, etc", "Kitten"
    Dog,"Substitution means table boilerplate can remain static.

    Line #2, #3, etc", "Puppy"
    Walrus,"#.  List Item 1
    #.  List Item 2
    #.  List Item 3", "Pup"

Post a Comment for "Can Multiple Paragraphs Be Substituted Into Restructuredtext Table Cells?"