2024 年日本 PHP 研討會

Vtiful\Kernel\Excel::setColumn

(PECL xlswriter >= 1.2.1)

Vtiful\Kernel\Excel::setColumn設定 Vtiful\Kernel\Excel 的欄寬

說明

public Vtiful\Kernel\Excel::setColumn(string $range, float $width, resource $format = ?)

設定欄位的格式。

參數

range

儲存格起始和結束座標字串

width

欄寬

format

儲存格格式資源

回傳值

Vtiful\Kernel\Excel 實例 (instance)

範例

範例 #1 setColumn 範例

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

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

$format = new \Vtiful\Kernel\Format($excel->getHandle());
$boldStyle = $format->bold()->toResource();

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

使用者貢獻的註釋

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