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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,462,024
Community Members
 
Community Events
176
Community Groups

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

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

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

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

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

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

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. 

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

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. 

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

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

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

Atlassian Community Events