Search
 
SCRIPT & CODE EXAMPLE
 

PHP

phpspreadsheet setcellvalue row background color

$spreadsheet = new Spreadsheet();

$spreadsheet->getActiveSheet()->getStyle('A1:F1')->applyFromArray([
    'fill' => [
            'fillType' => Fill::FILL_SOLID,
            'startColor' => [
                'rgb' => 'FFDBE2F1',
            ]           
    ],
]);


Or for single row//

$spreadsheet = new Spreadsheet();
 $sheet = $spreadsheet->getActiveSheet();
 { inside Loop
 $sheet->setCellValue('A1', 'ID');
 $sheet->setCellValue('B1', 'Data di caricamento');
 $sheet->setCellValue('C1', 'Via');
 $sheet->setCellValue('D1', 'Municipio 
$sheet->getStyle("A$cellIndex:I$cellIndex")->getFill()->setFillType(PhpOfficePhpSpreadsheetStyleFill::FILL_SOLID)->getStartColor()->setARGB($color);
          }// end loop here  
Comment

PREVIOUS NEXT
Code Example
Php :: php move file 
Php :: get page name wp 
Php :: php create 404 error 
Php :: searching and removing element from an array php 
Php :: how to print query in laravel 
Php :: regex for email php 
Php :: object to array in php 
Php :: wordpress debug true 
Php :: unset _post 
Php :: make model controller in single command 
Php :: validate audio file in laravel 
Php :: Laravel factory avatars 
Php :: how to run symfony project 
Php :: how to debug php 
Php :: Google_Service_Calendar Event Date Time 
Php :: return json response id name from eloquent all laravel 
Php :: laravel add (s) at the end of text based on how many data 
Php :: symfony exclude class from autowiring 
Php :: laravel migration on delete set null 
Php :: php header location to same page 
Php :: laravel save relationship to authorized user with parameter 
Php :: have_rows count acf php 
Php :: laravel cashier overwrite users table name 
Php :: zend redirect to url 
Php :: how to check number only in php 
Php :: fecade Artisan:call laravel 
Php :: laravel with trashed 
Php :: alert a php variable 
Php :: how to remove image from public storage in laravel 
Php :: drupal 7 entity_metadata_wrapper bundle 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =