2024 年日本 PHP 研討會

Vtiful\Kernel\Format::align

(PECL xlswriter >= 1.2.1)

Vtiful\Kernel\Format::alignVtiful\Kernel\Format 對齊方式

說明

public Vtiful\Kernel\Format::align(資源 $handle, int $style)

設定儲存格對齊方式

參數

handle

xlsx 檔案控制代碼

style

Vtiful\Kernel\Format 常數

回傳值

資源

範例

範例 #1 對齊樣式範例

<?php
$config
= [
'path' => './tests'
];

$excel = new \Vtiful\Kernel\Excel($config);
$excel->fileName('tutorial01.xlsx');

$format = new \Vtiful\Kernel\Format($excel->getHandle());
$alignStyle = $format->align(\Vtiful\Kernel\Format::FORMAT_ALIGN_LEFT)->toResource();

$excel->header(['name', 'age'])
->
data([['viest', 21]])
->
setColumn('A:A', 200, $alignStyle)
->
output();
?>
新增註釋

使用者貢獻的註釋

此頁面沒有使用者貢獻的註釋。
To Top