How to make tables in discourse


How to make a table with one row:

First you’ll want to start a header, and it will look something like this:

|This is a header|

Pretty simple right? just don’t forget the bars on each side


Next you’ll want to determine how many rows you want (i’ll get to columns later), the way you do this is a bit weird:

You’ll have to create a seqeuence of characters to show that you want X amount of rows

|---| ← is for one row and X amount of columns
|---|---| ← is for 2 rows and X amount of columns
|---|---|---| ← is for 3 rows and X amount of columns

|This is a header|
|---| <----This is to show you want one row

Alright, now we’ve decided how many rows we want, lets get to columns


How to add columns:

Now that we have an empty table set up, lets fill it with information

Under the part which determins how many rows you want, add a column by typing some sample text and surrounding it with bars on each side, like the following text

|Hi, i’m some data in the table.|

You can add as many columns as you want, and it will add more and more data to the table, a finished table will look something like the text below

|This is a header|
|---| <----This is to show you want one row
|Data 1|
|Data 2|
|Data 3|


This table would look like this if you were to see it in a topic:

This is a header
Data 1
Data 2
Data 3

Great, now you can successfully make a table


How to make a table with 2+ rows:

First, you’ll have to build two headers, and you’ll have to make a bar to separate both:

|Item 1|Item 2|

Something like that


Next, (this is important) determine how many rows you want:
|---|---| ← is for 2 rows and X amount of columns
|---|---|---| ← is for 3 rows and X amount of columns
|---|---|---|---| ← is for 4 rows and X amount of columns (i think you got the point)

Alright, to simplify things lets choose 2 rows. Our table should look like this:

|Item 1|Item 2|
|---|---|

Now lets add the rows, this is similar to how we make the header

We have to create two parts of the row separated by a bar, shown below
|Data 1a|Data 1b|


Now we pair this with the above in a similar way as we did for the table with one row, here is a completed table below

|Item 1|Item 2|
|---|---|
|Data 1a|Data 1b|
|Data 2a|Data 2b|
|Data 3a|Data 3b|

Item 1 Item 2
Data 1a Data 1b
Data 2a Data 2b
Data 3a Data 3b

This is infinetely expandable, and here are two tables with the first having 3 rows, and the second having 4:

3 Rows:
|Item 1|Item 2| Item 3|
|---|---|---|
|Data 1a|Data 1b|Data 1c|
|Data 2a|Data 2b|Data 2c|
|Data 3a|Data 3b|Data 3c|

Item 1 Item 2 Item 3
Data 1a Data 1b Data 1c
Data 2a Data 2b Data 2c
Data 3a Data 3b Data 3c

4 Rows:

|Item 1|Item 2| Item 3| Item 4|
|---|---|---|---|
|Data 1a|Data 1b|Data 1c|Data 1d|
|Data 2a|Data 2b|Data 2c|Data 2d|
|Data 3a|Data 3b|Data 3c|Data 3d|

Item 1 Item 2 Item 3 Item 4
Data 1a Data 1b Data 1c Data 1d
Data 2a Data 2b Data 2c Data 2d
Data 3a Data 3b Data 3c Data 3d

Ok so hopefully you can make tables of all sizes and shapes now, good luck

4 Likes

What

alternatively you can just use html
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
<td>Data 3</td>
</tr>
</table>

1 Like

i forgot how to do html

thank you for enlightening me with this info

i wast thinking some people could use this for vehicle suggestions but whatever

i probably wasted half an hour writing this

1 Like

I think I might use it in one of my suggestions

nvm

lol

too much text lol

1 Like

nope got it to work now

2 Likes