首页 > 解决方案 > 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

任何帮助,将不胜感激。

标签: pythonhtmlpluginshtml-tableetherpad

解决方案


推荐阅读