Sheena
Sheena

Reputation: 16212

phpExcel does not render borders

I'm trying to get phpExcel to draw a border around a bunch of cells.

This code:

print "<pre>";
print "{$aFirst['x']}{$aFirst['y']}:{$aLast['x']}{$aLast['y']}    ";
print_r($aStyle);
$oCurrentSheet->getStyle("{$aFirst['x']}{$aFirst['y']}:{$aLast['x']}{$aLast['y']}")->applyFromArray($aStyle);
print "</pre>";

prints this:

B2:AS5    Array
(
[borders] => Array
    (
        [outline] => Array
            (
                [style] => THIN
            )

    )

)

The excel workbook I am trying to render comes out perfectly except for the fact that there is no border. Any ideas?

Upvotes: 2

Views: 1168

Answers (1)

Mark Baker
Mark Baker

Reputation: 212402

Use the built-in constants: PHPExcel_Style_Border::BORDER_THIN.

Border styles are case-sensitive, and "THIN" should be "thin"

Upvotes: 1

Related Questions