Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php spreadsheet styles

$spreadsheet->getActiveSheet()->getStyle('B2')
    ->getFont()->getColor()->setARGB(PhpOfficePhpSpreadsheetStyleColor::COLOR_RED);
$spreadsheet->getActiveSheet()->getStyle('B2')
    ->getAlignment()->setHorizontal(PhpOfficePhpSpreadsheetStyleAlignment::HORIZONTAL_RIGHT);
$spreadsheet->getActiveSheet()->getStyle('B2')
    ->getBorders()->getTop()->setBorderStyle(PhpOfficePhpSpreadsheetStyleBorder::BORDER_THICK);
$spreadsheet->getActiveSheet()->getStyle('B2')
    ->getBorders()->getBottom()->setBorderStyle(PhpOfficePhpSpreadsheetStyleBorder::BORDER_THICK);
$spreadsheet->getActiveSheet()->getStyle('B2')
    ->getBorders()->getLeft()->setBorderStyle(PhpOfficePhpSpreadsheetStyleBorder::BORDER_THICK);
$spreadsheet->getActiveSheet()->getStyle('B2')
    ->getBorders()->getRight()->setBorderStyle(PhpOfficePhpSpreadsheetStyleBorder::BORDER_THICK);
$spreadsheet->getActiveSheet()->getStyle('B2')
    ->getFill()->setFillType(PhpOfficePhpSpreadsheetStyleFill::FILL_SOLID);
$spreadsheet->getActiveSheet()->getStyle('B2')
    ->getFill()->getStartColor()->setARGB('FFFF0000');
Source by phpspreadsheet.readthedocs.io #
 
PREVIOUS NEXT
Tagged: #php #spreadsheet #styles
ADD COMMENT
Topic
Name
5+6 =