python - setHTML 表格标签 etherpad-lite
问题描述
我正在尝试使用以下 HTML 插入setHTML
:
from etherpad_lite import EtherpadLiteClient
import pandas as pd
import numpy as np
import re ,sys, os
dfseg = pd.read_csv("Test.csv")
c = EtherpadLiteClient(base_params={'apikey':'xxxxxxxxxxx'}) #running as service and postgresql
def highlight_cols(s):
color = 'grey'
return 'background-color: %s' % color
result1= dfseg.to_string()
result = dfseg.to_html()
style1 = dfseg.style.applymap(highlight_cols, subset=pd.IndexSlice[:, ['rep_title', 'cat_title']])
df_html = style1.render()
df_html1 = """<html><head><title>Hello HTML</title> </head><body><p>""" + df_html + """</p></body></html>"""
try:
c.createPad(padID='TestBFSI26', html=df_html1)
except:
c.setHTML(padID='TestBFSI26', html=df_html1)
print("In Except")
我没有收到任何错误,但在垫子上查看时,我可以看到表格中的所有文本,但表格结构已被删除。
顺便说一句,我在 etherpad 控制台 [WARN] 控制台上收到警告 - 忽略不支持的元素(您可能想要安装插件):样式、表格、thead、tr、th、tbody、td
任何帮助,将不胜感激。
解决方案
推荐阅读
- php - 如何解决 laravel 中删除时找不到 409 页面错误?
- informatica - 在服务连接器中包含 CDATA 字段
- ios - 将本机流 ios 屏幕反应到本地服务器
- python - 从excel调用python函数
- angular - 重定向回Angular时如何防止再次调用方法
- reactjs - 从 React 组件中的道具设置 HTML 元素?
- jekyll - Jekyll/Liquid 相对 URL 过滤器会破坏链接
- tensorflow - 添加一个强制稀疏权重的损失项
- c# - .NET Core Windows 服务中的并行任务在几秒钟后挂起
- java - 什么是 LwjglApplicationConfiguration.forceExit,为什么默认为 true?