douwenpin0428 2016-10-06 12:54
浏览 207
已采纳

是否有使用Laravel Excel将列号转换为Excel列的内置方法

I want to add some style on a column using Laravel Excel. I know this column is the (let's say) 42nd, but I don't know the Excel code (like AA, BC, etc.).

I know I can build a function (based on this answer) to convert the column number to a letter, but I not sure it's the right way.

Is there a built-in way to convert a column number to an Excel column with Laravel Excel?

  • 写回答

2条回答 默认 最新

  • donglipi4495 2016-10-07 14:16
    关注

    There is a method in PHPExcel and i guess Laravel Excel uses that library.

    You can do like this:

    \PHPExcel_Cell::stringFromColumnIndex(1);
    

    This will return, B

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog