Home > OS >  PHPExcel Make Last row bold
PHPExcel Make Last row bold

Time:10-01

This is how we can make the First row text as bold:-

$sheet->getStyle('A1:'.$sheet->getHighestColumn().'1')->getFont()->setBold(true);

But how can we make the Last row of the sheet as bold?

CodePudding user response:

The function $sheet->getHighestRow() should be possible to use. So with your example above, you should be able to write:

$sheet->getStyle('A' . $sheet->getHighestRow() . ':'.$sheet->getHighestColumn().$sheet->getHighestRow())->getFont()->setBold(true);
  • Related