Format::setVAlign

Format::setVAlign – セルの配置を設定する

Synopsis

require_once "Spreadsheet/Excel/Writer.php";

void Format::setVAlign ( string $location )

Description

セルの配置を設定します。これは setAlign() の代替となるものです。

Parameter

  • string $location - セルの配置。

    topvcenterbottomvjustifyvequal_space

Note

This function can not be called statically.

Example

setVAlign() の使用法

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

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

// 均等割り付け
$format_justify =& $workbook->addFormat('vAlign' => 'vjustify');

// テキストの縦位置を中央揃えにします
$format_center =& $workbook->addFormat('vAlign' => 'vcenter');

// 縦位置を中央揃えにし、均等割り付けします
$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();
?>