Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do you create multiline tables with 3 columns in .rst?

Ashley Bird August 5, 2022

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

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 9, 2022

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

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

Kind regards,
Theodora

Ashley Bird August 9, 2022

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

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 10, 2022

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

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

Kind regards,
Theodora

Like Ashley Bird likes this
Ashley Bird October 21, 2022

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

Ashley Bird October 21, 2022

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. 

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 24, 2022

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

Like Ashley Bird likes this
Ashley Bird October 24, 2022

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. 

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 25, 2022

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.

Like Ashley Bird likes this
Ashley Bird October 25, 2022

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. 

Like Theodora Boudale likes this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 26, 2022

You are very welcome, please feel free to reach out if needed!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events