Home » Php » php – PHPExcel: Setting font size?

php – PHPExcel: Setting font size?

Posted by: admin April 23, 2020 Leave a comment


I have been looking to change the font size of some Excel cells using a PHP library called PHPExcel.

This is what I tried:


The method above does not work. I was wondering if anyone knows how to do this?

Many thanks in advance.

How to&Answers:

Use setSize method instead setFontSize, it should work:



If you want to use the style array, then you can do something like this:

$fontStyle = [
    'font' => [
        'size' => 16