插入批注
函数原型
insertComment(int $row, int $column, string $text): self
insertCommentOpt(int $row, int $column, string $text, array $options): self
showComment(): selfint $row
单元格所在行
int $column
单元格所在列
string $text
批注内容
array $options
批注扩展选项,所有键均为可选:
authorstring —— 批注作者
font_namestring —— 批注字体
font_sizedouble —— 批注字号
colorint —— 批注背景色(0xRRGGBB或Format::COLOR_*)
x_offsetint —— X 方向像素偏移
y_offsetint —— Y 方向像素偏移
x_scaledouble —— 横向缩放比例
y_scaledouble —— 纵向缩放比例
widthdouble —— 批注框宽度(像素)
heightdouble —— 批注框高度(像素)
visibleint —— 批注显示模式,推荐使用以下常量:
Excel::COMMENT_DISPLAY_DEFAULT—— 跟随工作簿全局开关
Excel::COMMENT_DISPLAY_HIDDEN—— 仅悬停时显示
Excel::COMMENT_DISPLAY_VISIBLE—— 始终常驻显示
start_rowint —— 批注框起始行
start_colint —— 批注框起始列
showComment() 用于打开整个工作簿的批注默认显示开关,调用一次即可对所有批注生效。
示例
Last updated