Markdown表格中合并单元格

I am trying to make some fancyish tables in a Discourse post and cant seem to get it to work. In a nut shell I want to merge some cells to place multiple cells underneath or similar. Is this possible?

This is my syntax

| | Grouping ||
First Header | Second Header | Third Header |
------------ | :-----------: | -----------: |
Content | Long Cell ||
Content | Cell | Cell |

This is what I get

| | Grouping ||

First Header Second Header Third Header
Content Long Cell
Content Cell Cell

This is what I am trying to do

image

Any advice is appreciated!

That seems like a copy paste of multimarkdown example.

And I think Discourse is using markdown.it. Therefore not possible to do in Discourse.

我正在寻找一种解决方案来合并论坛中的表格单元格,以优化显示界面,并允许在表格中添加图片。然后我找到了 jekyll-spaceship 的介绍
链接:https://stackoverflow.com/questions/46621765/can-i-merge-table-rows-in-markdown

那么有人已经将其集成到 discourse 的核心了吗?还没有吗?

1 个赞

目前还无法实现,Discourse 不支持 \u003ctd\u003e\u003cth\u003e 元素的 colspanrowspan 属性。我认为这也不在路线图上。

您或许可以通过自定义插件来添加对此的支持。请参阅:Whitelisting HTML tags / attributes

支持的 HTML 元素列表在此处:https://github.com/discourse/discourse/blob/main/app/assets/javascripts/pretty-text/addon/allow-lister.js#L115。表格标签似乎在此处:https://github.com/discourse/discourse/blob/main/app/assets/javascripts/pretty-text/engines/discourse-markdown/table.js

也许这会有所帮助。

如果您想请求在核心功能中允许使用 colspanrowspan 属性,您可以创建一个新的 Feature 主题。:slight_smile:

2 个赞

谢谢,我将参考该类别功能中的文章示例以获得明确的建议。

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.