如何使用PHP格式化Excel表格单元格

时间:2022-09-15 21:13:17

Please help me about my doubts on excel and php. I need to do the following process on excel report generation using php

请帮助我解决我对excel和php的疑问。我需要使用php对excel报告生成进行以下处理

  1. to change cell's font styles
  2. 更改单元格的字体样式。
  3. to change cell's BG color
  4. 改变细胞的BG颜色
  5. to change cell's width
  6. 改变细胞的宽度

3 个解决方案

#1


4  

Try PHPExcel. I started using it few days ago and it works very good.

PHPExcel试试。我几天前就开始用了,效果很好。

#2


2  

With PHPExcel

与PHPExcel

With PEAR Spreadsheet Excel Writer

使用PEAR电子表格Excel Writer

  • Format::setBgColor – Sets the cell's background color
  • 格式::setBgColor—设置单元格的背景颜色。
  • Format::setFontFamily – Sets the font family.
  • 格式::setFontFamily -设置字体族。
  • Worksheet::setColumn – Set the width of a single column or a range of columns.
  • 工作表::setColumn——设置一列或一列的宽度。

#3


0  

I'd definitely recommend PHPExcel as well, and it may well supercede the SEW within the PEAR repository

我当然也推荐PHPExcel,它很可能取代PEAR存储库中的SEW

#1


4  

Try PHPExcel. I started using it few days ago and it works very good.

PHPExcel试试。我几天前就开始用了,效果很好。

#2


2  

With PHPExcel

与PHPExcel

With PEAR Spreadsheet Excel Writer

使用PEAR电子表格Excel Writer

  • Format::setBgColor – Sets the cell's background color
  • 格式::setBgColor—设置单元格的背景颜色。
  • Format::setFontFamily – Sets the font family.
  • 格式::setFontFamily -设置字体族。
  • Worksheet::setColumn – Set the width of a single column or a range of columns.
  • 工作表::setColumn——设置一列或一列的宽度。

#3


0  

I'd definitely recommend PHPExcel as well, and it may well supercede the SEW within the PEAR repository

我当然也推荐PHPExcel,它很可能取代PEAR存储库中的SEW