如何使用Markdown在表单元格中嵌套代码块? [英] How to nest code block within a table cell using Markdown?
问题描述
我想像这样在markdown表单元格中写一些多行代码
I'd like write some multiline code in markdown table cells like this
|pointers|`int a;` <br> `int *pa = &a;`||
我必须在代码的每一行写< br>
,是否可以使用代码块来做到这一点?
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; ```||
推荐答案
您不能高效/快速地执行此操作.您可以避免使用
并像这样格式化它:
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.
这篇关于如何使用Markdown在表单元格中嵌套代码块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!