Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 23892 программиста и 1389 роботов. Сейчас ищут 1232 программиста ...

Format::setBgColor

Вернуться к: Spreadsheet_Excel_Writer

Format::setBgColor

Format::setBgColor – Sets the cell's background color

Synopsis

require_once "Spreadsheet/Excel/Writer.php";

void Format::setBgColor ( mixed $color )

Sets the cell's "background color".

The term "background color" is misleading. Here, "background" means the bottom layer of a cell's background.

This method only comes into play when creating patterns via the setPattern() method. In general, chances are you are more interested in using the setFgColor() method.

The example entitled "How background and foreground colors interact with patterns" is very helpful.

Parameter

  • mixed $color - either a string (like 'blue'), or an integer (range is [8...63]).

    Please see the "Using colors" section of the manual for more information.

Note

This function can not be called statically.

Example

Using setBgColor()

<?php
require_once 'Spreadsheet/Excel/Writer.php';

$workbook = new Spreadsheet_Excel_Writer();
$worksheet =& $workbook->addWorksheet('testing bg color');
$worksheet->setRow(130);

$format6 =& $workbook->addFormat();
$format6->setBgColor('green');
$format6->setPattern(6);
$worksheet->write(11'the bg'$format6);

$workbook->send('setBgColor.xls');
$workbook->close();
?>


Вернуться к: Spreadsheet_Excel_Writer

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware