Note: This only works in Jekyll due to usage of Liquid syntax.
Markdown syntax only supports one line in table cells. We use Liquid (used in Jekyll) to make it easier to add lists and other elements into the markdown table.
Steps:
- Create the table layout using pure markdown
- Use a temporary string as a placeholder to substitute the variables later
- Use
markdownify
to convert the markdown table into HTML - Do a simple text substitution of the placeholder text with whatever cell content we want to actually place
Example:
{% capture SUB %}
* Item 1
* Item 2
{% endcapture %}
{% assign SUB = SUB | markdownify %}
{% capture TABLE %}
| Look Below! |
|---------------|
| :placeholder: |
{% endcapture %}
{{ TABLE
| markdownify
| replace: ":placeholder:", SUB
}}
Note that since the text substitution happens at the HTML step (after the markdown parsing), this means we also have to pass in the markdownify
-ed table cell contents. In the above example, this step is done in line 5 (the reassignment of the SUB
variable).
Result:
Look Below! |
---|
|
You can then use CSS to eliminate the extra spacing that is introduced.