Is there a way to center the text in all cells? The number of rows will vary based on user interaction, as will the number of cells. So I need a way to set an overall alignment for the sheet.
Hello, you can try to do this:
Excel::create('Filename', function($excel) {
$excel->getDefaultStyle()
->getAlignment()
->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER)
});
Also to vertically center the text:
->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER)
Most helpful comment
Hello, you can try to do this: