插入批注

函数原型

insertComment(int $row, int $column, string $text): self

insertCommentOpt(int $row, int $column, string $text, array $options): self

showComment(): self

int $row

单元格所在行

int $column

单元格所在列

string $text

批注内容

array $options

批注扩展选项,所有键均为可选:

  • author string —— 批注作者

  • font_name string —— 批注字体

  • font_size double —— 批注字号

  • color int —— 批注背景色(0xRRGGBBFormat::COLOR_*

  • x_offset int —— X 方向像素偏移

  • y_offset int —— Y 方向像素偏移

  • x_scale double —— 横向缩放比例

  • y_scale double —— 纵向缩放比例

  • width double —— 批注框宽度(像素)

  • height double —— 批注框高度(像素)

  • visible int —— 批注显示模式,推荐使用以下常量:

    • Excel::COMMENT_DISPLAY_DEFAULT —— 跟随工作簿全局开关

    • Excel::COMMENT_DISPLAY_HIDDEN —— 仅悬停时显示

    • Excel::COMMENT_DISPLAY_VISIBLE —— 始终常驻显示

  • start_row int —— 批注框起始行

  • start_col int —— 批注框起始列

showComment() 用于打开整个工作簿的批注默认显示开关,调用一次即可对所有批注生效。

示例

Last updated