自适应卡:如何在不截断文本的情况下创建具有6列的表格? [英] Adaptive Card: How to create table with 6 columns without truncating text?

查看:61
本文介绍了自适应卡:如何在不截断文本的情况下创建具有6列的表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个自适应卡,以表格形式显示.但是,该文本正像 Today I ... 一样被截断,而不是 Today In Count 完整文本.

I have created a adaptive card to show as table. But, the text is getting truncated like Today I... instead of Today In Count complete text.

此自适应卡适用于Microsoft Teams.

This Adaptive card is for Microsoft Teams.

自适应卡:

{
   "$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
   "type":"AdaptiveCard",
   "version":"1.2",
   "body":[
      {
         "type":"ColumnSet",
         "columns":[
            {
               "type":"Column",
               "items":[
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"Zone",
                     "weight":"bolder"
                  },
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"EAST ZONE",
                     "separator":true
                  }
               ]
            },
            {
               "type":"Column",
               "items":[
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"Today In Counter",
                     "weight":"bolder"
                  },
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"168",
                     "separator":true
                  }
               ]
            },
            {
               "type":"Column",
               "items":[
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"Monthly Count (A)",
                     "weight":"bolder"
                  },
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"5884",
                     "separator":true
                  }
               ]
            },
            {
               "type":"Column",
               "items":[
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"Cancel (B)",
                     "weight":"bolder"
                  },
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"1",
                     "separator":true
                  }
               ]
            },
            {
               "type":"Column",
               "items":[
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"Return (C)",
                     "weight":"bolder"
                  },
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"19",
                     "separator":true
                  }
               ]
            },
            {
               "type":"Column",
               "items":[
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"NET Re Count (A-B-C)",
                     "weight":"bolder"
                  },
                  {
                     "type":"TextBlock",
                     "isSubtle":true,
                     "width":"stretch",
                     "text":"5864",
                     "separator":true
                  }
               ]
            }
         ]
      }
   ]
}

输出:

如何在所有列中获取全文或如何增加列宽?

How to get complete text in all columns or How to increase width of column?

更新1:

在设计器中将 width:'stretch'更改为 width:'auto'后,即使选择 host app作为Microsoft Teams ,它也能正常工作.但是不能在实际的团队应用程序上工作.

After changing width: 'stretch' to width: 'auto' in designer it working fine even after selecting host app as Microsoft Teams. But not working on actual teams application.

有什么建议吗?

预期输出:

推荐答案

虽然您不能像Manish所说的那样加宽自适应卡,但是可以包装文本,以便每个单元格根据需要变高.为了将单元格设置为整齐的行而不是仅列的格式,可以按照此答案中的说明为每行使用单独的列集:

While you cannot widen your Adaptive Cards like Manish said, you can wrap the text so that each cell becomes taller as needed. In order to format the cells into neat rows instead of just columns, you can use a separate column set for each row as explained in this answer: Is there a way I can give column padding to an adaptive card- Adaptive MS BOT

这篇关于自适应卡:如何在不截断文本的情况下创建具有6列的表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆