Table To Xls 介绍
Java实现,HTML table转换为Excel,支持大部分样式,欢迎提出意见或者建议,后续 可能 ,只是说可能会增加外部样式支持。
有图有真相:
转换结果:
代码托管在 http://git.oschina.net/chyxion/table-to-xls
欢迎捧场,拍砖。
使用方式:
1、添加Maven依赖
<dependency> <groupId>me.chyxion</groupId> <artifactId>table-to-xls</artifactId> <version>0.0.1-RELEASE</version> </dependency>
2、使用
StringBuilder html = new StringBuilder(); Scanner s = new Scanner(getClass().getResourceAsstream("/sample.html"), "utf-8"); while (s.hasNext()) { html.append(s.nextLine()); } s.close(); FileOutputStream fout = new FileOutputStream("data.xls"); fout.write(TabletoXls.process(html)); fout.close();
好了,大功告成。
Table To Xls 官网
http://git.oschina.net/chyxion/table-to-xls
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。