Example #1
0
 /**
  * Sets borders of cells.
  * @param BorderFormat &$borderFormat Border format
  * @param $startRow Start row
  * @param $startColumn Start column
  * @param $endRow End row. If 0, then border format is set just for one row cells.
  * @param $endColumn End column. If 0, then border format is set just for one column cells.
  * @param boolean $left If false, left border is not set (default true)
  * @param boolean $top If false, top border is not set (default true)
  * @param boolean $right If false, right border is not set (default true)
  * @param boolean $bottom If false, bottom border is not set (default true)
  * @access public
  */
 function setBordersOfCells(&$borderFormat, $startRow, $startColumn, $endRow = 0, $endColumn = 0, $left = true, $top = true, $right = true, $bottom = true)
 {
     Table::rowsCols($startRow, $startColumn, $endRow, $endColumn);
     if ($this->checkIfCellExists($startRow, $startColumn) && $this->checkIfCellExists($endRow, $endColumn)) {
         for ($row = $startRow; $row <= $endRow; $row++) {
             for ($column = $startColumn; $column <= $endColumn; $column++) {
                 $cell =& $this->getCell($row, $column);
                 $cell->setBorders($borderFormat, $left, $top, $right, $bottom);
             }
         }
     }
 }