1

Hello: I'm using PHPExcel in a project and need to apply different styles in the same cell.

This is an example: example image

as I can do?

Thank you!

Ariel
  • 13
  • 2

1 Answers1

0

You can do this using Rich Text. This is documented and there is an example provided in 05featuredemo.inc.php

There is even a helper utility in the 1.8.1 release that can be used to convert a block of html markup to a PHPExcel Rich Text Run, and example 42richText.php demonstrating how to use it.

Mark Baker
  • 209,507
  • 32
  • 346
  • 385
  • Thanks, I could use Rich Text but have the same problem: Excel5 writer seems broken when adding many RichText cells. Reference link https://github.com/PHPOffice/PHPExcel/issues/284 as I can solve it? – Ariel Sep 06 '15 at 22:41
  • Using Rich Text is the only way of applying different styles to text in the same cell.... how many is "many"? – Mark Baker Sep 06 '15 at 22:58
  • for example, this report is good and has 7 rows http://aysys010.com.ar/report_ok.xls but this report that has 44 rows fails to open and lose formatting http://aysys010.com.ar/report_error.xls – Ariel Sep 06 '15 at 23:47
  • in the last example, if the Rich Text to remove any of the columns the file opens without error – Ariel Sep 07 '15 at 00:19