繁体   English   中英

如何在Microsoft Bot框架中以表格格式显示数据

[英]How to display data in Table format in microsoft bot framework

可以请我帮忙在BOT中显示数据表格式如下

在此处输入图片说明

您可以利用自适应卡中ColumeSet来呈现类似卡消息的表格。

EG,以下json内容将呈现为类似于卡片消息的表格:

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "TextBlock",
                            "weight": "bolder",
                            "text": "Name"
                        },
                        {
                            "type": "TextBlock",
                            "separator":true,
                            "text": "Apple"
                        },{
                            "type": "TextBlock",
                            "separator":true,
                            "text": "Kiwi"
                        }
                    ]
                },
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "TextBlock",
                            "weight": "bolder",
                            "text": "Tag"
                        },
                        {
                            "type": "TextBlock",
                            "separator":true,
                            "text": "Fruit"
                        },{
                            "type": "TextBlock",
                            "separator":true,
                            "text": "Fruit"
                        }
                    ]
                },
                {
                    "type": "Column",
                    "items": [
                        {
                            "type": "TextBlock",
                            "weight": "bolder",
                            "text": "Price"
                        },
                        {
                            "type": "TextBlock",
                            "separator":true,
                            "text": "2"
                        },{
                            "type": "TextBlock",
                            "separator":true,
                            "text": "1"
                        }
                    ]
                }
            ]
        }
    ]
}

在WebChat频道中,它看起来像:

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM