previousFormat::setAlign (Previous) (Next) Format::setHAlignnext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Format::setVAlign

Format::setVAlign – Set cell alignment.

Synopsis

require_once "Spreadsheet/Excel/Writer.php";

void Format::setVAlign ( string $location )

Description

Set cell alignment. This is an alternative to setAlign()

Parameter

  • string $location - alignment for the cell

    top, vcenter, bottom, vjustify, vequal_space.

Note

This function can not be called statically.

Example

Using setVAlign()

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

$workbook = new Spreadsheet_Excel_Writer();
$worksheet =& $workbook->addWorksheet();

// justify 
$format_justify =& $workbook->addFormat('vAlign' => 'vjustify');

// center the text vertically
$format_center =& $workbook->addFormat('vAlign' => 'vcenter');

// justify and center vertically
$format_justify_center =& $workbook->addFormat();
$format_justify_center->setVAlign('vjustify');
$format_justify_center->setVAlign('vcenter');

$worksheet->write(00'justify'$format_justify);
$worksheet->write(10'center'$format_center);
$worksheet->write(20'jc'$format_justify_center);

$workbook->send('align.xls');
$workbook->close();
?>
previousFormat::setAlign (Previous) (Next) Format::setHAlignnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.