tomk79 / php-excel2html
使用PHPExcel将Excel(*.xlsx)转换为HTML表格。
0.1.2
2023-02-04 17:14 UTC
Requires
- php: >=7.2
- michelf/php-markdown: ^1.6.0
- phpoffice/phpspreadsheet: ^1.13
- tomk79/filesystem: 1.*
Requires (Dev)
- phpunit/phpunit: ^4.8.0
README
将Excel(*.xlsx)转换为HTML表格。(使用PhpSpreadsheet)。
将Excel形式的文件转换为HTML的table标签。(使用PhpSpreadsheet)
基本用法 - 使用方法
使用composer
命令将tomk79/php-excel2html安装到项目中。(有关composer
的详细信息,请参阅composer文档)
$ composer require tomk79/php-excel2html
以下是一个实现示例。
<?php require_once( './vendor/autoload.php' ); $src = (new \tomk79\excel2html\main('path/to/your/excel.xlsx'))->get_html(array( 'renderer'=>'simplify' )); print $src;
选项 - 选项
- string renderer
- 渲染模式。
simplify
(简化)、或strict
(原样显示)中的任一指定。默认为strict
。对于CSV文件,无论设置如何,都强制选择simplify
。 - string cell_renderer
- 单元格的渲染模式。
html
(作为HTML代码处理)、text
(作为纯文本处理)或markdown
(作为Markdown处理)中的任一指定。默认为text
。 - bool render_cell_width
- 重现单元格宽度。
- bool render_cell_height
- 重现单元格高度。
- bool render_cell_background
- 重现单元格背景设置。
- bool render_cell_font
- 重现单元格文字设置。
- bool render_cell_borders
- 重现单元格边框。
- bool render_cell_align
- 重现单元格左右对齐。
- bool render_cell_vertical_align
- 重现单元格上下对齐。
- int header_row
- 标题行的编号。默认为0。
- int header_col
- 标题列的编号。默认为0。
- bool strip_table_tag
- 是否删除table标签。true时,以删除table标签的状态输出。默认为false。
更新日志 - Change log
tomk79/php-excel2html v0.1.2 (2023年2月5日)
- 内部代码的细微修正。
tomk79/php-excel2html v0.1.1 (2020年10月17日)
- 修复了单元格合并时HTML表格崩溃的问题。
- 设置了超链接的单元格现在可以通过a元素重现链接。
tomk79/php-excel2html v0.0.9 (2020年10月17日)
- 设置了超链接的单元格现在可以通过a元素重现链接。
tomk79/php-excel2html v0.1.0 (2020年6月11日)
- 将Excel文件解析库从PHPExcel迁移到PhpSpreadsheet。
- 根据PhpSpreadsheet更新系统要求。PHP 7.1.x以下不再适用,并增加了几个PHP扩展作为要求。
tomk79/php-excel2html v0.0.8 (2020年6月11日)
- 修复了PHPExcel特定处理中可能出现的异常终止问题。
tomk79/php-excel2html v0.0.7 (2016年10月18日)
- 修复了PHPExcel特定处理中可能出现的异常终止问题。
tomk79/php-excel2html v0.0.6 (2016年10月17日)
- 修复了最后一行合并时列宽指定缺失的问题。
tomk79/php-excel2html v0.0.5 (2016年10月4日)
- michelf/php-markdown 更新
tomk79/php-excel2html v0.0.4 (2015年7月28日)
- 修复了PHP5.4系列中存在的问题。
tomk79/php-excel2html v0.0.3 (2015年7月9日)
- 分离并调整了输入CSV时的处理、添加了详细的渲染选项。
- 根据格式设置显示单元格值。
tomk79/php-excel2html v0.0.2 (2015年6月18日)
- 修正了单元格宽度以
%
计算。 - 其他错误修正。
tomk79/php-excel2html v0.0.1 (2015年6月9日)
- 首次发布。
许可证 - License
MIT许可证
作者 - Author
- (C)Tomoya Koyanagi tomk79@gmail.com
- 网站: https://www.pxt.jp/
- 推特: @tomk79 https://twitter.com/tomk79/