简体   繁体   中英

How to display data in Table format in microsoft bot framework

Can some one please help me out in displaying the data table format in BOT as below

在此处输入图片说明

You can leverage the ColumeSet in adaptive card to render a table like card message.

EG, the following json content will be renderred a table like card message:

{
    "$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"
                        }
                    ]
                }
            ]
        }
    ]
}

in WebChat channel, it looks like:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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