# 行 / 列设置

* 扩展版本大于等于 `1.6.0`；
* 编译时需添加 `--enable-reader`；

读取指定行或列的尺寸、隐藏、分级显示等属性，以及工作表默认行高与列宽。

## 函数原型

```php
getRowOptions(int $row): ?array
getColumnOptions(string $column): ?array
getDefaultRowHeight(): ?float
getDefaultColumnWidth(): ?float
```

### **int $row**

> 行号，0 起。

### **string $column**

> 列字母，如 `"A"`、`"AB"`。

## 返回值

`getRowOptions()` 返回数组：

* `height` *(float|null)* — 行高（点）；未自定义时为 `null`；
* `hidden` *(bool)* — 是否隐藏；
* `outline_level` *(int)* — 分级显示级别；
* `collapsed` *(bool)* — 是否折叠；
* `custom_height` *(bool)* — 是否使用自定义行高。

`getColumnOptions()` 返回数组：

* `width` *(float|null)* — 列宽（字符宽）；
* `hidden` *(bool)* — 是否隐藏；
* `outline_level` *(int)* — 分级显示级别；
* `collapsed` *(bool)* — 是否折叠。

`getDefaultRowHeight()` / `getDefaultColumnWidth()` 返回工作表 `<sheetFormatPr>` 中声明的默认值，未声明时返回 `null`。

## 示例

```php
$config = ['path' => './tests'];
$excel  = new \Vtiful\Kernel\Excel($config);

$excel->openFile('source.xlsx')->openSheet();

print_r($excel->getRowOptions(0));
// Array ( [height] => 24 [hidden] => false [outline_level] => 0 [collapsed] => false [custom_height] => true )

print_r($excel->getColumnOptions('B'));
// Array ( [width] => 18 [hidden] => false [outline_level] => 0 [collapsed] => false )

var_dump($excel->getDefaultRowHeight());   // float(15)
var_dump($excel->getDefaultColumnWidth()); // float(8.43) 或 NULL
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xlswriter-docs.viest.me/zhong-wen-jian-ti/reader/row-column-options.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
