Microsoft Teams中Adaptive Card表格不遵循列宽问题排查求助
Adaptive Card表格列宽在Teams工作流Webhook中不生效问题
12月27日更新
经进一步排查,问题似乎与工作流配置为以用户身份还是Workflow bot身份发布有关
12月23日更新
问题疑似由Teams工作流的Webhook导致。将负载发送至该工作流时无法正常渲染,但发送至即将弃用的传统Webhook时渲染符合预期。
原始问题
尝试使用Adaptive Card创建表格并通过Teams工作流发送至Webhook,但无论如何设置表格列权重(硬编码像素宽度除外,这违背了自适应的初衷),在Microsoft Teams中列宽均不生效,但在Microsoft Adaptive Card预览工具中显示正常。不确定遗漏了什么,欢迎提供建议。
预期效果

实际效果

所用Adaptive Card代码
{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.5", "body": [ { "columns": [ { "items": [ { "text": "✅ Intune Applications Created Using Local-Content (4)", "weight": "bolder", "size": "large", "wrap": true, "type": "TextBlock" } ], "width": "stretch", "type": "Column" }, { "items": [ { "url": "https://iili.io/JjeJoEx.png", "size": "Medium", "horizontalAlignment": "Right", "type": "Image" } ], "width": "auto", "type": "Column" } ], "separator": true, "type": "ColumnSet" }, { "columns": [ { "width": "1" }, { "width": "5" }, { "width": "3" }, { "width": "3" }, { "width": "2" } ], "firstRowAsHeader": true, "gridStyle": "emphasis", "rows": [ { "cells": [ { "items": [ { "text": "", "isSubtle": true, "style": "heading", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "Product", "isSubtle": true, "style": "heading", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "Severity", "isSubtle": true, "style": "heading", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "Classification", "isSubtle": true, "style": "heading", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "CVEs", "isSubtle": true, "style": "heading", "type": "TextBlock" } ], "type": "TableCell" } ], "type": "TableRow" }, { "cells": [ { "items": [ { "url": "https://raw.githubusercontent.com/smcallister594/scotscottmca/refs/heads/main/assets/images/7-Zip.png", "size": "Small", "type": "Image" } ], "type": "TableCell" }, { "items": [ { "text": "[7-Zip 24.09 (EXE-x64)](http://www.7-zip.org/history.txt)", "wrap": true, "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "Important", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "Security", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "1", "type": "TextBlock" } ], "type": "TableCell" } ], "type": "TableRow" }, { "cells": [ { "items": [ { "url": "https://raw.githubusercontent.com/smcallister594/scotscottmca/refs/heads/main/assets/images/7-Zip.png", "size": "small", "type": "Image" } ], "type": "TableCell" }, { "items": [ { "text": "[7-Zip 24.09 (EXE-x86)](http://www.7-zip.org/history.txt)", "wrap": true, "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "Important", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "Security", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "1", "type": "TextBlock" } ], "type": "TableCell" } ], "type": "TableRow" }, { "cells": [ { "items": [ { "url": "https://raw.githubusercontent.com/smcallister594/scotscottmca/refs/heads/main/assets/images/7-Zip.png", "size": "Small", "type": "Image" } ], "type": "TableCell" }, { "items": [ { "text": "[7-Zip 24.09 (MSI-x64)](http://www.7-zip.org/history.txt)", "wrap": true, "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "Important", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "Security", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "1", "type": "TextBlock" } ], "type": "TableCell" } ], "type": "TableRow" }, { "cells": [ { "items": [ { "url": "https://raw.githubusercontent.com/smcallister594/scotscottmca/refs/heads/main/assets/images/7-Zip.png", "size": "Small", "type": "Image" } ], "type": "TableCell" }, { "items": [ { "text": "[7-Zip 24.09 (MSI-x86)](http://www.7-zip.org/history.txt)", "wrap": true, "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "Important", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "Security", "type": "TextBlock" } ], "type": "TableCell" }, { "items": [ { "text": "1", "type": "TextBlock" } ], "type": "TableCell" } ], "type": "TableRow" } ], "verticalCellContentAlignment": "Center", "separator": true, "type": "Table" }, { "columns": [ { "items": [ { "url": "https://patchmypc.com/wp-content/uploads/2018/06/Patch20My20PC20-20Logo20Horizontal20-20300ppi.png", "size": "Medium", "width": "180px", "type": "Image" } ], "width": "auto", "verticalContentAlignment": "Center", "type": "Column" }, { "items": [ { "text": "Report generated on **CM1**. Intune Tenant: **ScotScottMcA**", "size": "small", "isSubtle": true, "wrap": true, "horizontalAlignment": "Right", "spacing": "None", "type": "TextBlock" }, { "text": "12/20/2024 3:23:11 PM (GMT Standard Time)", "size": "small", "isSubtle": true, "horizontalAlignment": "Right", "spacing": "None", "type": "TextBlock" } ], "width": "stretch", "verticalContentAlignment": "Center", "type": "Column" } ], "separator": true, "spacing": "None", "type": "ColumnSet" } ], "msteams": { "width": "Full" } }
内容的提问来源于stack exchange,提问作者Scott McAllister
相关产品推荐
相关产品推荐

