如何通过pandas生成html格式?
如何通过pandas生成html文件文件中包含多个表单
Balance_64_data = pd.read_sql(Balance_64_sql,engine)

df = pd.DataFrame(np.random.randn(4,2))
df.columns = ['A', 'B']
df.index = ['a', 'b', 'c', 'd']

html_string = '''
<html>
<head><title>HTML Pandas Dataframe with CSS</title></head>
<link rel="stylesheet" type="text/css" href="df_style.css"/>
<body>
<div style="width:20px;margin-left: 20px;">{table} </div>
<div style="height: 20px;width:"> </div>
<div style="height: 20px;width:"> </div>
<div style="height: 20px;width:"> </div>
<div style="height: 20px;width:"> </div>
<div style="height: 20px;width:20px;margin-left: 80px;"> {table1}</div>
<div style="height: 20px;width:20px;float: right;"></div>
</body>
</html>
'''
with open('myhtml.html', 'w') as f:
f.write(html_string.format(table1=Balance_64_data.to_html(classes='mystyle'),table=df.to_html(classes='mystyle')))

pandas 生成html文档,支持可添加多个表的更多相关文章

  1. ASP.NET MVC 5使用Swagger生成API文档

    一.安装 新建一个没有身份验证的mvc项目 - SwaggerMvc5Demo,然后添加一个名为Remote(自定义)且包含基础读写(不想手写)的ApiController   开源地址:https: ...

  2. ASP.NET WEBAPI 使用Swagger生成API文档

    一.安装 新建一个没有身份验证的mvc项目 - SwaggerMvc5Demo,然后添加一个名为Remote(自定义)且包含基础读写(不想手写)的ApiController   开源地址:https: ...

  3. Spring boot 添加日志 和 生成接口文档

    <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring- ...

  4. WebAPI使用多个xml文件生成帮助文档

    一.前言 上篇有提到在WebAPI项目内,通过在Nuget里安装(Microsoft.AspNet.WebApi.HelpPage)可以根据注释生成帮助文档,查看代码实现会发现是基于解析项目生成的xm ...

  5. POI生成WORD文档

    h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h ...

  6. PHP的学习--使用PhpDocumentor 2生成API文档

    官网地址:http://www.phpdoc.org/ 项目地址:https://github.com/phpDocumentor/phpDocumentor2 phpDocumentor 2是一个可 ...

  7. WebAPI使用多个xml文件生成帮助文档(转)

    http://www.cnblogs.com/idoudou/p/xmldocumentation-for-web-api-include-documentation-from-beyond-the- ...

  8. VS2010/MFC编程入门之二(利用MFC向导生成单文档应用程序框架)

    VS2010/MFC编程入门之二(利用MFC向导生成单文档应用程序框架)-软件开发-鸡啄米 http://www.jizhuomi.com/software/141.html   上一讲中讲了VS20 ...

  9. PHPDoc/PHPDocumentor生成API文档

    PHPDocumentor是一个用PHP写的强大的文档自动生成工具,对于有规范注释的php程序,能够快速生成具有结构清晰.相互参照.索引等功能的API文档.旧版本是PHPDoc,PHPDoc是PEAR ...

随机推荐

  1. pytest参数化代码笔记

    #!/usr/local/bin/python3 # -*- coding: utf-8 -*- import pytest __author__ = "Carp-Li" __da ...

  2. TNS-12541 TNS no listener

    转载:https://blog.csdn.net/haha_201510/article/details/88119587 centOS环境下的解决方案: 查看监听状态lsnrctl status 如 ...

  3. python3异步爬虫 ——aiohttp模板使用

    一.简单使用和讲解 import aiohttp import asyncio async def fetch(client): async with client.get('http://httpb ...

  4. C2. Balanced Removals (Harder) (幾何、思維)

    Codeforce 1237C2 Balanced Removals (Harder) (幾何.思維) 今天我們來看看CF1237C2 題目連結 題目 給你偶數個三維座標點,每次選其中兩點,如果兩點為 ...

  5. 新版本 swagger 组件中 Servers 的 坑

    新版本 Swashbuckle swagger 组件中 Servers 的 坑 Intro 上周做了公司的项目升级,从 2.2 更新到 3.1, swagger 直接更新到了最新,swagger 用的 ...

  6. K8S的StorageClass实战(NFS)

    欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...

  7. GPRS DTU的工作原理和应用场景有哪些

    GPRS DTU是属于物联网无线数据终端设备的中一种,它主要是利用公用运营商的GPRS网络(又称G网)来为用户提供无线长距离数据传输的功能.一般都是采用的高性能工业级8/16/32位通信处理器和工业级 ...

  8. 《Clojure编程》笔记 第2章 函数式编程

    目录 背景简述 第2章 函数式编程 背景简述 本人是一个自学一年Java的小菜鸡,理论上跟大多数新手的水平差不多,但我入职的新公司是要求转Clojure语言的.坊间传闻:通常情况下,最好是有一定Jav ...

  9. 错误解析:org.apache.catalina.LifecycleException: Protocol handler start failed

    以下是报错代码: org.apache.catalina.LifecycleException: Protocol handler start failed at org.apache.catalin ...

  10. linux的mysql修改默认端口3306

    linux 修改mysql默认端口3306 cd /etc/mysql/my.cnf 修改两处 客户端的port=3306 和mysqld的服务器端口port=3306 [client] port=3 ...