0

Trying to change the background color of the sheet title with PHPSpreadsheet. No success with something like

`$sheet ->getTitle($sheet1)->getStyle()->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID);`

How would you address that specific cell ?

JDEC
  • 93
  • 8

2 Answers2

0

Get the argb value of color you want to set and write it in setARGB.

$cells='A1';
$spreadsheet->getActiveSheet()->getStyle($cells)->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB('ffffff');
Premlatha
  • 1,676
  • 2
  • 20
  • 40
0

$worksheet->getTabColor()->setRGB('FF0000');

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 25 '22 at 19:18