13

Should it be possible to put a table inside an ordered list in markdown? If not, whats a recommended alternative way to do it?

Tim
  • 1,080

2 Answers2

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.

It should look like this:
enter image description here

xypha
  • 4,352
Swicher
  • 186
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