sets background color of cells of a given cell range
public setBackgroundForCellRange ( string $backgroundColor, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | ||
$backgroundColor | string | background color |
$startRow | integer | start row |
$startColumn | integer | start column |
$endRow | integer | end row, if null, then rotation is set only to the row range. |
$endColumn | integer | end column, if null, then rotation is set just to the column range. |
/** * tests setBackgroundForCellRange */ public function testSetBackgroundForCellRange() { $backgroundColor = '#00F'; $this->_table->addRows(3); $this->_table->addColumnsList(array(5, 5, 5)); $this->_table->setBackgroundForCellRange($backgroundColor, 1, 1, 2, 2); for ($rowIndex = 1; $rowIndex <= 2; $rowIndex++) { for ($columnIndex = 1; $columnIndex <= 2; $columnIndex++) { $cell = $this->_table->getCell($rowIndex, $columnIndex); $this->assertEquals($backgroundColor, $cell->getBackgroundColor()); } } }