Should it be possible to put a table inside an ordered list in markdown? If not, whats a recommended alternative way to do it?
Asked
Active
Viewed 1.2k times
2 Answers
17
Another way to do this is by adding two or more spaces (according to the level of nesting) at the beginning of the rows. Therefore this:
1. Some item
2. Item with table
| xx|yyy|
|---|---|
|aa|bb|
* Nested item with table
| xx|yyy|
|---|---|
|aa|bb|
3. Another item.
-
This is great - though I needed 3 spaces for this to work correctly. 2 spaces had no effect. – Lukasz Oct 16 '20 at 08:44
-
For me it must be 4 spaces – sify Feb 13 '22 at 10:50
3
I can't find a way to get it only with markdown. but you can use Inline HTML to replace ordered list, like
<ol>
<li> 1st
|xx|yyy|
|-|-|
|aa|bb|
<li>.
.
.
.
you can refer to https://stackoverflow.com/questions/19950648/how-to-write-lists-inside-a-markdown-table
Cheney
- 139
- 5
-
The link refers to a different problem, putting a list in a table rather than putting a table in a list. – ggorlen Sep 19 '21 at 00:20
