美文网首页
objPHPExcel

objPHPExcel

作者: 聚米01 | 来源:发表于2021-05-14 14:37 被阅读0次

    //合并

           $objPHPExcel->getActiveSheet()->mergeCells('L5:L'.$zong);//合并

            $objPHPExcel->getActiveSheet()->mergeCells('M5:M'.$zong);//合并


    //居中

    $objPHPExcel->getActiveSheet()->getStyle('M5:M'.$zong)->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER);//垂直居中 $objPHPExcel->getActiveSheet()->getStyle('M5:M'.$zong)->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);//左右居中


    //加颜色

    $objPHPExcel->getActiveSheet()->getStyle('A4:M4')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);

      $objPHPExcel->getActiveSheet()->getStyle('A4:M4')->getFill()->getStartColor()->setARGB('3399cc');


    //所有数据加边框

            $styleThinBlackBorderOutline = array(

                'borders' => array(

                    'allborders' => array( //设置全部边框

                        'style' => \PHPExcel_Style_Border::BORDER_THIN //粗的是thick

                    ),

                ),

            );

            $objPHPExcel->getActiveSheet()->getStyle('A1:M'.$zong)->applyFromArray($styleThinBlackBorderOutline);

    相关文章

      网友评论

          本文标题:objPHPExcel

          本文链接:https://www.haomeiwen.com/subject/rclqjltx.html