Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Formatting an Excel Column

// Format column as percentage
$sheet->setColumnFormat(array(
    'C' => '0%'
));

// Format a range with e.g. leading zeros
$sheet->setColumnFormat(array(
    'A2:K2' => '0000'
));

// Set multiple column formats
$sheet->setColumnFormat(array(
    'B' => '0',
    'D' => '0.00',
    'F' => '@',
    'F' => 'yyyy-mm-dd',
));
Source by docs.laravel-excel.com #
 
PREVIOUS NEXT
Tagged: #Formatting #Excel #Column
ADD COMMENT
Topic
Name
2+2 =