How do you create multiline tables with 3 columns in .rst?
Asked by Ashley Bird:

I am currently documenting parameters in .rst format. I would love a solution for creating a clean multiline table in .rst. Does anyone have a solution? I am using this format:

Can you make this table multiline?

I read that you can use a single bar line ( \| ) to add multiple lines, but I have not succeeded.  

```
.. list-table:: Title   :widths: 25 25 50   :header-rows: 1   * - Heading row 1, column 1     - Heading row 1, column 2     - Heading row 1, column 3   * - Row 1, column 1     - Row 1, column 2     - Row 1, column 3     - Row 1, column 3   * - Row 2, column 1     - Row 2, column 2     - Row 2, column 3
```


Answers:
author: Theodora Boudale
body: Hi Ashley,

The example you provided has 4 columns in the 1st row (**- Row 1, column 3** is there twice), while the rest of the rows have 3 columns.

If I remove the extra **- Row 1, column 3** and use the following in an .rst file committed in my repo:

```
.. list-table:: Title
   :widths: 25 25 50
   :header-rows: 1

   * - Heading row 1, column 1
     - Heading row 1, column 2
     - Heading row 1, column 3
   * - Row 1, column 1
     - Row 1, column 2
     - Row 1, column 3
   * - Row 2, column 1
     - Row 2, column 2
     - Row 2, column 3
```

Then the table shows as follows:

![Screenshot 2022-08-09 at 12.41.24.png](https://community.atlassian.com/t5/image/serverpage/image-id/210199i9D741EB50242A241/image-size/large?v=v2&px=999 "Screenshot 2022-08-09 at 12.41.24.png")

Is this what you are expecting to see? And does it work if you remove the 4th column from the example?

Kind regards,  
Theodora

comments: author: Ashley Bird
body: Hi Theodora,

Thank you for your help! Yes I should have explained. That was my attempt at trying to add more rows within a row. I need. to add a "description," and it is multiple sentences. These tables are only lone-line sentences. It gets tricky to format a table with content in the rows. I have not found a solution yet. I decided o just list my parameters.

Sincerely,

Ashley


author: Theodora Boudale
body: Hi Ashley,

Thank you for the clarification, I did not understand the issue initially.

Just to make sure I understand correctly, you are looking to have multiple rows/new lines within a table cell?

I have tried using the vertical pipe ( \| ) you mentioned, and the following content:

```
.. list-table:: Title
   :widths: 25 25 50
   :header-rows: 1

   * - Heading row 1, column 1
     - Heading row 1, column 2
     - Heading row 1, column 3
   * - Row 1, column 1
     - Row 1, column 2
     - | Row 1, column 3
       | Another row
       | A third row
   * - Row 2, column 1
     - Row 2, column 2
     - Row 2, column 3
```

will format the table like this:

![Screenshot 2022-08-10 at 13.52.46.png](https://community.atlassian.com/t5/image/serverpage/image-id/210428i1903FCFA34C2EA44/image-size/large?v=v2&px=999 "Screenshot 2022-08-10 at 13.52.46.png")

Is this what you are looking for? Or were you looking for something different?

Kind regards,  
Theodora


author: Ashley Bird
body: Hi Theodora,

This is actually what im looking for. I wonder if I can add, for example, three sentences or more. It gets really hard to have more content and keep the integrity of the table. I will try and replicate this!

Thank you,

Ashley


author: Ashley Bird
body: I wonder if its possible to create a table that has 20-30 rows.. with multi-line text in one of the columns?. I am trying to create a table for Parameters in .rst.


author: Theodora Boudale
body: Hi Ashley,

Thank you for the feedback. You are asking
> I wonder if its possible to create a table that has 20-30 rows.. with multi-line text in one of the columns?. I am trying to create a table for Parameters in .rst.

Could you please explain how this is different from the example I gave you in my previous reply?

Kind regards,  
Theodora


author: Ashley Bird
body: Your answer is correct. It just gets difficult with actually putting content inside the table and then also keeping the table formatted for it to render in HTML. I will work on this and do my best to create a working table. Your answer is the best I have had since I started the search. I don't think there is any other solution.


author: Theodora Boudale
body: Ok, Ashley. If you run into any issues that you'd like some help with, it would be useful to have a demo of the content you are using, a screenshot of what you are seeing (it doesn't have to be the actual content of your file, it could be some demo code to demonstrate the issue) and an explanation on how you would like it to be formatted instead. Please feel free to let me know.


author: Ashley Bird
body: Hi Theodora,

I used your table example yesterday to show. I spoke with a coworker and discovered that one of the issues was a CSS fix. If I run into another issue as I build, I would love your help. Thank you for all the support. If I need more assistance, I will be happy to show a demo of what it is I am attempting.


author: Theodora Boudale
body: You are very welcome, please feel free to reach out if needed!


Tags: bitbucket-cloud

cloud