带合并文本的合并单元格上的PHPExcel行自动高度 [英] PHPExcel row autoheight on merged cells w/ wrapText

查看:436
本文介绍了带合并文本的合并单元格上的PHPExcel行自动高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有很好的方法在PHP Excel中设置行自动高度? 到目前为止,我已经看到您可以使用固定的高度,在此位置之前,您可以预先指定希望该行的高度.我还看到,如果不使用合并的单元格,则可以使用自动高度.

Is there a good way to set row autoheight in PHP Excel? So far I have seen that you can use a fixed height where you specify before hand how tall you want the row. I have also seen that you can use autoheight if you are not using merged cells.

PHPExcel-合并单元格的动态行高

如何在phpexcel中设置自动高度?

这两个其他问题也提出了类似的问题,但均未得到回答.我考虑过的一种解决方案是计算单元格中的单词数,并根据该值和列跨度进行换行.但是,这可能会打开一罐蠕虫.

These two other questions ask similar questions but neither is answered. One solution I've considered is to count the number of words in the cell and wrap based on that and the column span. This could open a can of worms however.

推荐答案

您也可以这样做

  1. 合并所需的单元格,例如:A7:C7
  2. 将其上下文复制到一个单元格(例如Z7)
  3. 将合并的单元格的宽度设置为Z7
  4. 将自动换行文本应用于Z7
  5. 使Z7不可见

这篇关于带合并文本的合并单元格上的PHPExcel行自动高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆