PHPExcel and Text Wrapping

后端 未结 3 1917
借酒劲吻你
借酒劲吻你 2021-01-30 20:19

I know that this line of code will make the cell text-wrap:

$objPHPExcel->getActiveSheet()->getStyle(\'D1\')->getAlignment()->setWrapText(true);
         


        
3条回答
  •  被撕碎了的回忆
    2021-01-30 20:37

    Apply to column

    $highestRow = $$objPHPExcel->getActiveSheet()->getHighestRow();
    for ($row = 1; $row <= $highestRow; $row++){
        $sheet->getStyle("D$row")->getAlignment()->setWrapText(true);
    }
    

提交回复
热议问题