Skip to content

Instantly share code, notes, and snippets.

@outman
Created September 21, 2012 07:14
Show Gist options
  • Save outman/3760142 to your computer and use it in GitHub Desktop.
Save outman/3760142 to your computer and use it in GitHub Desktop.
phpexcel set border
// set border
$sheet->getStyle("A1:I{$offset}")->applyFromArray(array(
'borders' => array(
'allborders' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
)
)
));
// set array value
$rows = 2;
foreach ($ret as $row) {
$cols = 0;
foreach ($row as $cell) {
$sheet->getCellByColumnAndRow($cols, $rows)
->setValueExplicit($cell, PHPExcel_Cell_DataType::TYPE_STRING);
$cols ++;
}
$rows ++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment