从通过 pandas 创建的html表中删除边框 [英] Remove border from html table created via pandas
问题描述
我使用python脚本在网页上显示数据框。我使用 df.to_html
将我的数据框转换为HTML。但是,默认情况下,它将边框设置为0.我尝试通过定制css模板覆盖它,但它不起作用。
这是我的熊猫代码:
ricSubscription.to_html(classes ='mf')
是否有一个参数可以在调用此函数时将border设置为零?
你可以这样做: 另外,要具体回答,似乎没有任何事情可以通过。 I am using a python script to display dataframe on a webpage. I used Here is my pandas code: Is there a parameter I can pass to set the border to zero while making this call? You could just do: Also, to answer specifically, there does not appear to be anything you can pass. 这篇关于从通过 pandas 创建的html表中删除边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!< table border =1class =dataframe> ...
$ b
ricSubscription。 to_html()。replace('border =1','border =0')
border =1
似乎是硬编码的: $ b df.to_html
to convert my dataframe to HTML. However, by default, it sets the border to 0. I tried overriding it by having a custom css template but it didn't work.ricSubscription.to_html(classes='mf')
to_html()
generates <table border="1" class="dataframe">...
ricSubscription.to_html().replace('border="1"','border="0"')
border="1"
appears to be hardcoded: