Have two columns in Markdown

后端 未结 3 1360
花落未央
花落未央 2020-12-01 10:26

I would like to write a coding standard specification document with good and bad coding examples. Each rule should have a number, a description and an exam

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 10:53

    While this doesn't work for all markdown's, I got this to work with GitLab, Github, and mdBook. I thought I'd share this answer.

    Basically, you create the table via HTML. Markdown and HTML don't mix well, but if you surround the markdown with white-space, sometimes the markdown can be recognized.

    https://docs.gitlab.com/ee/user/markdown.html#inline-html

    Good Bad
    ```c++ int foo() { int result = 4; return result; } ``` ```c++ int foo() { int x = 4; return x; } ```

提交回复
热议问题