问题
I'd like write some multiline code in markdown table cells like this
|pointers|`int a;` <br> `int *pa = &a;`||
I've to write <br>
at each line of the codes, Whether I can do this, i.e., using code blocks?
|pointers|```c int a; int *pa = &a; ```||
回答1:
You can not do this efficiently/quickly. You could avoid using
however and format it like this :
| Pointers |
| -------- |
| `int a;` |
| `int *pa = &a;` |
| etc.. |
It does take more time, but I am aware that there is no alternate way to nest an entire code block. You can use the "```" method but it can only be single line.
Also generally make sure to have the |------| under the title of the table. It's also a good habit to get into indenting and spacing your code for clarity.
来源:https://stackoverflow.com/questions/30021157/how-to-nest-code-block-within-a-table-cell-using-markdown