I
I
Igor2019-06-14 19:21:19
PHP
Igor, 2019-06-14 19:21:19

How to format part of text using phpexcel?

I am creating a report using phpexcel. It is necessary to make a part of the text in a cell of a different size and set a different color. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Immortal_pony, 2019-06-14
@Immortal_pony

$fontStyle = [
    'font' => [
        'bold'  => true,
        'color' => ['rgb' => "FF0000"],
        'size' => 15,
        'name' => "Verdana"
    ]
];
$workbook->getActiveSheet()
    ->getStyle("F1:G1")
    ->applyFromArray($fontStyle);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question