简体   繁体   中英

How to set a font size in header in PHPexcel?

How do I set the font size for the title in my reprot in PHPExcel?

I tried the code below, but it did't work:

$objPHPExcel->getActiveSheet()->getHeaderFooter()
         ->setOddHeader('&C&HINTERVIEW WORKSHEET')->getFont()->setSize(25);

What's the correct way to achieve this?

See section 4.6.13 of the developer documentation, entitled "Setting the print header and footer of a worksheet".... there's a table of codes there.

Setting font size is listed in those codes, & followed by the point size.

$objPHPExcel->getActiveSheet()->getHeaderFooter()
    ->setOddHeader('&C&H&25INTERVIEW WORKSHEET');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM