XLSX
批注
为单元格添加批注和备注
添加批注
为工作表中的单元格添加批注(Excel 中的传统注释):
{
"worksheets": [
{
"name": "With Comments",
"rows": [
{ "cells": [{ "value": "Product" }, { "value": "Price" }, { "value": "Stock" }] },
{ "cells": [{ "value": "Widget A" }, { "value": 9.99 }, { "value": 150 }] },
{ "cells": [{ "value": "Widget B" }, { "value": 14.99 }, { "value": 75 }] },
{ "cells": [{ "value": "Widget C" }, { "value": 24.99 }, { "value": 0 }] }
],
"comments": [
{ "cell": "B2", "author": "Alice", "text": "Discounted from 12.99" },
{ "cell": "C3", "author": "Bob", "text": "Reorder soon" },
{ "cell": "C4", "author": "Alice", "text": "Out of stock!" }
]
}
]
}
{
name: "With Comments",
rows: [
{ cells: [{ value: "Product" }, { value: "Price" }, { value: "Stock" }] },
{ cells: [{ value: "Widget A" }, { value: 9.99 }, { value: 150 }] },
{ cells: [{ value: "Widget B" }, { value: 14.99 }, { value: 75 }] },
{ cells: [{ value: "Widget C" }, { value: 24.99 }, { value: 0 }] },
],
comments: [
{ cell: "B2", author: "Alice", text: "Discounted from 12.99" },
{ cell: "C3", author: "Bob", text: "Reorder soon" },
{ cell: "C4", author: "Alice", text: "Out of stock!" },
],
}
批注选项参考
| 选项 | 类型 | 说明 |
|---|---|---|
cell | string | 单元格引用,如 "B2" |
author | string | 批注作者 |
text | string | 批注文本内容 |