PHPExcel Make first row bold

后端 未结 10 884
猫巷女王i
猫巷女王i 2020-12-13 03:34

I am trying to make cells in first row are bold.

This is the method I have created for that purpose.

function ExportToExcel($tittles,$excel_name)
 {
         


        
10条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 03:58

    Try this for range of cells:

    $from = "A1"; // or any value
    $to = "B5"; // or any value
    $objPHPExcel->getActiveSheet()->getStyle("$from:$to")->getFont()->setBold( true );
    

    or single cell

    $cell_name = "A1";
    $objPHPExcel->getActiveSheet()->getStyle( $cell_name )->getFont()->setBold( true );
    

    hope that helps

提交回复
热议问题