6

I am trying to write a bullet list in markdown table, however I am unable to do so. I tried the solutions given here, and here.

I am writing the following table in bitbuckets readme.md file.

| **Date**   | **A** | **B**  
|:----------:|:-----:|:------: 
|    2016    |  Something  | <ul><li>A</li><li>B</li><li>C</li></ul> 

Every row of column B contains a bullet list of 2 items. How can I achieve this ? What am I missing ? Please let me know. Thanks in advance.


I used the answer given by @Dorgrin in the post mentioned as a possible duplicate. Even while using that I was not able to get a list displayed. What I was shown was html code as plain text in the third column which is not the intended effect.

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
akadam
  • 65
  • 1
  • 2
  • 6
  • Possible duplicate of [Markdown list inside a table](http://stackoverflow.com/questions/17956377/markdown-list-inside-a-table) – Waylan Jun 21 '16 at 13:18
  • 1
    How is this different that the two questions you linked to? The answers to those questions would be the same answer here. Your list needs to be in raw HTML. It is not possible to put a Markdown list inside a table cell as table cells cannot hold block level constructs. – Waylan Jun 21 '16 at 13:20
  • @Waylan I did do raw html which was suggested in those two answers and that didn't work for me. Hence I thought I am missing something. – akadam Jun 21 '16 at 13:23
  • Can you edit your question and show an example of what did not work for you? – Waylan Jun 21 '16 at 13:23
  • @Waylan I edited the question and also mentioned specific solutions I tried. – akadam Jun 21 '16 at 16:57
  • Okay, I just checked the source of your question and made an edit so I could see your actual Markdown code. You are doing it correctly. If that is not working, then whichever Markdown implementation you are using either doesn't support tables or has a bug. Curious, why do you have `
    ` tags at the end of every line?
    – Waylan Jun 21 '16 at 17:34
  • Ohh it was just use to break the lines so that the table appears properly in the post. – akadam Jun 21 '16 at 17:40
  • Thanks anyways. Should I close this questions @Waylan? – akadam Jun 21 '16 at 17:40

2 Answers2

6

Bitbucket is lagging behind on supported features. Apparently they allow html in markdown README files, but they decided not to support it in snippets.

I say "apparently" because I just tried it, and it doesn't even work. See this repo.

I decided to ask them a question about this. You can follow further developments here


On a more positive note, what you had works well on Github as you can see here:

| **Date**   | **A** | **B**  
|:----------:|:-----:|:------: 
|    2016    |  Something  | <ul><li>A</li><li>B</li></ul><ul><li>C</li></ul> |

<script src="https://gist.github.com/smac89/bc0ff6c7e41396293367b00df626317b.js"></script>
smac89
  • 39,374
  • 15
  • 132
  • 179
  • HI @Smac89, Thanks for your help. Your solution works perfectly fine on github. However I am using bitbucket on which it doesn't seem to work. I tried multiple approaches however I feel bitbucket doesn't support that feature yet. let me know if you disagree ? – akadam Jun 21 '16 at 22:59
  • Well according to [this](https://bitbucket.org/tutorials/markdowndemo/overview#markdown-header-tables), bitbucket does not support html in markdown, so I don't know what else to suggest except to switch to github or gitlab which both do; Gitlab is a bit limited but it supports `ul` and `li` tags at least. – smac89 Jun 22 '16 at 00:31
  • @akadam actually it seems that [it does](https://bitbucket.org/tutorials/markdowndemo/overview#markdown-header-bitbucket-does-not-support), but you have to escape the tags or something – smac89 Jun 22 '16 at 00:40
  • It's amazing your solution still works smoothly! Just what I needed for doing a Test Case Writing Table. @smac89 – NoahVerner Feb 24 '22 at 23:27
1

You can mimic the visual affect of a bulleted lists in a markdown table with the ascii character and the <br> tag for a line break.

|           | Apples | Oranges |
|-----------|--------|---------|
|attributes | • color: red <br> • shape: round | • color: orange <br> • shape: round |
|tasty      | yes | yes |

Renders like this

enter image description here

I think this keeps the table clean of the html clutter from using the <li> and <ol>/<ul> tags.

blaylockbk
  • 2,503
  • 2
  • 28
  • 43