How to make a nice table in a post?

This is the noted table. The topic was split so that it would not be buried in another post.

n 4chan lower bound L₂(n) Current Best Minimal Superpermutation Length Known to be minimum Current Best Minimal Superpermutation
1 - - 1 Yes 1
2 - - 3 Yes 121
3 9 - 9 Yes 123121321
4 33 34 33 Yes 123412314231243121342132413214321
5 152 154 153 Yes 123451234152341253412354123145231425314235142315423124531243512431524312543121345213425134215342135421324513241532413524132541321453214352143251432154321
6 867 873 872 No 12345612345162345126345123645132645136245136425136452136451234651234156234152634 15236415234615234165234125634125364125346125341625341265341235641235461235416235 41263541236541326543126453162435162431562431652431625431624531642531462531426531 42563142536142531645231465231456231452631452361452316453216453126435126431526431 25643215642315462315426315423615423165423156421356421536241536214536215436215346 21354621345621346521346251346215364215634216534216354216345216342516342156432516 43256143256413256431265432165432615342613542613452613425613426513426153246513246 53124635124631524631254632154632514632541632546132546312456321456324156324516324 56132456312465321465324165324615326415326145326154326514362514365214356214352614 35216435214635214365124361524361254361245361243561243651423561423516423514623514 263514236514326541362541365241356241352641352461352416352413654213654123
7 5884 5,908 5,906 No 5906 link
8 46,085 46,205 46,205 No 46,205
9 408,246 408,966 408,966 No 408,966

Since all of the post are HTML and most of the basic HTML will pass through the Discourse filters unchanged, I created the table by typing in raw HTML. Remember I was coding during the days of punch cards, so there was a time when all HTML was coded by hand and yes I did many HTML pages by hand coding the HTML.

The raw HTML used in this post is

<table>
<tr>
<th>n</th>
<th>4chan lower bound</th>
<th>L₂(n)</th>
<th><a href=https://groups.google.com/forum/#!topic/superpermutators/bkaogtr9zqE>Current Best Minimal Superpermutation Length</a></th>
<th>Known to be minimum</th>
<th>Current Best Minimal Superpermutation</th>
</tr>
<tr>
<td>1</td>
<td>-</td>
<td>-</td>
<td>1</td>
<td><a href="http://www.njohnston.ca/2014/08/all-minimal-superpermutations-on-five-symbols-have-been-found/">Yes</a></td>
<td>1</td>
</tr>
<tr>
<td>2</td>
<td>-</td>
<td>-</td>
<td>3</td>
<td>Yes</td>
<td>121</td>
</tr>
<tr>
<td>3</td>
<td>9</td>
<td>-</td>
<td>9</td>
<td>Yes</td>
<td>123121321</td>
</tr>
<tr>
<td>4</td>
<td>33</td>
<td>34</td>
<td>33</td>
<td>Yes</td>
<td>123412314231243121342132413214321</td>
</tr>
<tr>
<td>5</td>
<td>152</td>
<td>154</td>
<td>153</td>
<td>Yes</td>
<td>123451234152341253412354123145231425314235142315423124531243512431524312543121345213425134215342135421324513241532413524132541321453214352143251432154321</td>
</tr>
<tr>
<td>6</td>
<td>867</td>
<td>873</td>
<td>872</td>
<td>No</td>
<td>12345612345162345126345123645132645136245136425136452136451234651234156234152634
15236415234615234165234125634125364125346125341625341265341235641235461235416235
41263541236541326543126453162435162431562431652431625431624531642531462531426531
42563142536142531645231465231456231452631452361452316453216453126435126431526431
25643215642315462315426315423615423165423156421356421536241536214536215436215346
21354621345621346521346251346215364215634216534216354216345216342516342156432516
43256143256413256431265432165432615342613542613452613425613426513426153246513246
53124635124631524631254632154632514632541632546132546312456321456324156324516324
56132456312465321465324165324615326415326145326154326514362514365214356214352614
35216435214635214365124361524361254361245361243561243651423561423516423514623514
263514236514326541362541365241356241352641352461352416352413654213654123</td>
</tr>
<tr>
<td>7</td>
<td>5884</td>
<td>5,908</td>
<td>5,906</td>
<td>No</td>
<td><a href="https://www.gregegan.net/SCIENCE/Superpermutations/Superpermutations.html#NEWS2">5906</a></td>
<td><a href=https://www.gregegan.net/SCIENCE/Superpermutations/7_5908.txt>link</a></td>
</tr>
<tr>
<td>8</td>
<td>46,085</td>
<td>46,205</td>
<td>46,205</td>
<td>No</td>
<td><a href=https://www.gregegan.net/SCIENCE/Superpermutations/8_46205.txt>46,205</a></td>
</tr>
<tr>
<td>9</td>
<td>408,246</td>
<td>408,966</td>
<td>408,966</td>
<td>No</td>
<td><a href=https://raw.githubusercontent.com/superpermutators/superperm/master/superpermutations/9/408966.txt>408,966</a></td>
</tr>
</table>

How did I get the HTML code to show as HTML code?

```html
HTML code
```

How did I get the Markdown code (```html and ```) to show as markdown code?

<pre>
Markdown code
</pre>

How did I get the <pre> and <\pre> tags to show?

Just bookend the section with ```.


Lets’ just say that I have done it more ways wrong than most people have done it and so now know the right ways.


For a more complicated table that tried to insert SVG images generated using GraphViz DOT see this. As best as I can figure, Discourse does not allow links to images in HTML table cells. So the images should be side by side and not top to bottom.


This is a wiki so that you can click on image in the lower right of this post and see the raw HTML.


EDIT 09/19/2019

See: Discourse meta - Can someone explain post formatting with HTML?

2 Likes