当前位置:   article > 正文

基于python 将表格 转化成html_python &excel 报表转html

python &excel 报表转html

安装包 pip install xlsx2html
xlsx 表格样式如
在这里插入图片描述
在这里插入图片描述
将excel 表格的内容转化成html ,并在页面中显示
直接上代码

# -*- coding: utf-8 -*-
# 将表格 转化成html
import re
import os
from xlsx2html import xlsx2html
def re_html(name,proname):
    tb1_html = str(name).replace('.xlsx','c.html')
    tb2_html = str(name).replace('.xlsx','m.html')
    xlsx2html(filepath=name, sheet='Chemical Composition',output=tb1_html)
    try:
        
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/249984
推荐阅读
相关标签
  

闽ICP备14008679号