php - How to apply styles in PHPExcel -


i working phpexcel & want give same style cells. have tried below code, applies style a1.

$objphpexcel->getactivesheet()->getstyle('a1','b2','b3','c4')->getalignment()->setindent(1); 

you can't provide list of cells 'a1','b2','b3','c4' because getstyle() accepts single argument; argument can either single cell (e.g. 'a1') or range of cells 'a1:c4'

so

$objphpexcel->getactivesheet()     ->getstyle('a1:c4')     ->getalignment()->setindent(1); 

is acceptable, , recommended because it's lot more efficient setting styles range individual cells


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -