.text()
テキストを追加します。
入力形式
シンプルなテキスト
.text("タイトル")
スタイル付きテキスト
.text({
value: "重要なテキスト",
style: { bold: true, fontSize: 14, color: "#FF0000" }
})
TextInput
| 形式 | 説明 |
|---|---|
string | プレーンテキスト |
{ value, style? } | スタイル付きテキスト |
使用例
const output = await xlmake()
.sheet("レポート")
.text({ value: "売上レポート", style: { bold: true, fontSize: 16 } })
.text("2024年1月分")
.space(2)
.table({
preset: "basic",
columns: [...],
data: [...],
})
.space(1)
.text("※ 金額は税抜きです")
.getNode();
スタイルオプション
styleにはCellStyleのプロパティを指定できます。
.text({
value: "警告メッセージ",
style: {
bold: true,
color: "#FF0000",
fontSize: 12,
}
})
関連
- スタイルAPI - CellStyleの詳細