Created
September 21, 2012 07:14
-
-
Save outman/3760142 to your computer and use it in GitHub Desktop.
phpexcel set border
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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