datatable set max width code example
Example 1: phpexcel set width
$this->PhpExcel->createSheet($page);
$this->PhpExcel->setActiveSheetIndex($page);
$sheet = $this->PhpExcel->getActiveSheet();
$sheet->getColumnDimension('A')->setWidth(40);
$sheet->getColumnDimension('B')->setWidth(28);
$sheet->getColumnDimension('C')->setWidth(25);
$sheet->getStyle("A8:C8")->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
Example 2: datatable column width
columnDefs: [
{ width: 200, targets: 0 }
],