pymsteams icon indicating copy to clipboard operation
pymsteams copied to clipboard

HTML tables stopped working

Open talbaumel opened this issue 3 years ago • 4 comments

Describe the bug I used to send HTML tables on my automatic msg, this feature stopped working (probably teams changed someting)

To Reproduce Just try to post this msg, the table won't appear "<h2>My table:</h2> <table border="1" class="dataframe">\n <thead>\n <tr style="text-align: right;">\n <th></th>\n <th>0</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>1</td>\n </tr>\n <tr>\n <th>1</th>\n <td>2</td>\n </tr>\n <tr>\n <th>2</th>\n <td>3</td>\n </tr>\n </tbody>\n</table> 123"

Expected behavior See the table in the card

Screenshots

Additional context

talbaumel avatar Nov 21 '22 15:11 talbaumel

Seems like the problem is because of the title

talbaumel avatar Nov 21 '22 16:11 talbaumel

hello @talbaumel ,

we have the same problem here, table which were correctly displayed before disappeared. Even ones which were correctly viewable before. It looks like due to an update of teams since some users still using old version of teams can see content.

What do you mean by title ? There is no title in your sample of code ?

Also, we had noted 2/3 months ago that images embbed in html disappeared (although they are still publicly accessible), but didn't investigate further.

yeyeric avatar Dec 06 '22 13:12 yeyeric

Anything after the header disappeared, when changing the msg from my original post to:

"*My table:* <br> <table border="1" class="dataframe">\n <thead>\n <tr style="text-align: right;">\n <th></th>\n <th>0</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>1</td>\n </tr>\n <tr>\n <th>1</th>\n <td>2</td>\n </tr>\n <tr>\n <th>2</th>\n <td>3</td>\n </tr>\n </tbody>\n</table> 123"

I could see the table

talbaumel avatar Dec 07 '22 07:12 talbaumel

while waiting for the fixes, here my experience. With my body_old, the table does not show.

body_old = f"""
DATE : {date}
TARGET : {t:.1%}
{output.to_html()}
"""

With my body_new, the problem is gone.

body_new = f"Date : {date}<br/>TARGET : {t:.1%}<br/>{output.to_html()}"

giahung24 avatar Dec 08 '22 17:12 giahung24