-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
This is a bug report
What is the expected behavior?
I want to select a row in spreadsheet and set color for bottom borders of every cell on the row.
What is the current behavior?
It works, but it sets black color for all the rows except for the last one. And only the last cell border gets the color I want.
What are the steps to reproduce?
<?php
require __DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet->getActiveSheet()
->getStyle('A10:H10')
->getBorders()
->getBottom()
->setBorderStyle(Border::BORDER_THIN)
->setColor(new Color('FFFF0000'));
$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
$writer->save('file.xlsx');
As far as I remember the same approach worked fine in PHPExcel. Anyway, it actually draws the bottom border, the main question is why this border is black, not red? And only the last cell in a row is red.
Which versions of PhpSpreadsheet and PHP are affected?
PHP 7.2.3
PhpSpreadsheet 1.2.0
Checked resulting file in latest Microsoft Excel versions for Mac and Windows.