previousWorksheet::protect (Previous) (Next) Worksheet::writeColnext

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

Worksheet::setColumn

Worksheet::setColumn – 単一の列、または指定した範囲の列の幅を設定する

Synopsis

require_once "Spreadsheet/Excel/Writer.php";

void Worksheet::setColumn ( integer $firstcol , integer $lastcol , float $width , mixed $format=0 , integer $hidden=0 )

Description

単一の列、あるいは指定した範囲の列の幅を設定します。

Parameter

  • integer $firstcol - 範囲の最初の列です。

  • integer $lastcol - 範囲の最後の列です。

  • float $width - 設定する幅です。

  • mixed $format - カラムに適用するオプションの XF フォーマットです。

  • integer $hidden - オプションの隠し属性です。

Note

This function can not be called statically.

Example

setColumn() の使用法

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

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

$radius 20;
$worksheet->setColumn(0,$radius*2,1);

// 顔
for ($i 0$i 360$i++)
{
    
$worksheet->write(floor(sin((2*pi()*$i)/360)*$radius) + $radius 1floor(cos((2*pi()*$i)/360)*$radius) + $radius 1"x");
}
// 目 (代わりに書式を使用したほうがよいかも?)
$worksheet->writeURL(floor($radius*0.8), floor($radius*0.8), "0");
$worksheet->writeURL(floor($radius*0.8), floor($radius*1.2), "0");

// 笑顔
for ($i 65$i 115$i++)
{
    
$worksheet->write(floor(sin((2*pi()*$i)/360)*$radius*1.3) + floor($radius*0.2), floor(cos((2*pi()*$i)/360)*$radius*1.3) + $radius 1"x");
}

// この Excel アートを台無しにしないために、枠線を非表示にします
$worksheet->hideGridLines();

$workbook->send('face.xls');
$workbook->close();
?>
previousWorksheet::protect (Previous) (Next) Worksheet::writeColnext

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
Note by: Brandon Bergren
It seems that the column width unit is "one character" in the "normal font."
See
http://support.microsoft.com/kb/214123