CellFrame
更多信息
- 该选项作为边框的厚度以点数指定. 值 0 表示无边框.
- 可能的设置有:
-
dist 边框所有边的规范 {{left,right},{bottom,top}} 边框各个边上不同的规范 - 边框和单元内容指定的空隙由 CellFrameMargins 确定. 边框的颜色由 CellFrameColor 确定.
- 标志符在边框外部.
- None、False 或 0 相互等价,作用是不画出指定边框. True 等价于值 0.5.
- 可以使用窗口 ▶ 工具条中的默认工具条交互式地修改边框.
范例
打开所有单元 关闭所有单元基本范例 (2)
范围 (7)
指定 (4)
CellPrint[ExpressionCell[{1, 2, 3, 4, 5}, "Print", CellFrame -> True]]CellPrint[ExpressionCell[{1, 2, 3, 4, 5}, "Print", CellFrame -> 3]]CellPrint[ExpressionCell[{1, 2, 3, 4, 5}, "Print", CellFrame -> {{1, 3}, {5, 7}}]]CellPrint[ExpressionCell[{1, 2, 3, 4, 5}, "Print", CellFrame -> {{0, 0}, {3, 3}}]]用法 (3)
单元框架适用于顶层单元,如那些由 CellPrint 生成的单元:
CellPrint[ExpressionCell[{a, b, c}, "Print", CellFrame -> True]]在下面的例子中,垂直边框的位置由 CellMargins 确定:
CellPrint[ExpressionCell[{a, b, c}, "Print", CellFrame -> True, CellMargins -> {{200, 300}, {5, 5}}]]单元框适用于内嵌单元,例如通过计算 ExpressionCell 或 TextCell 创建的单元:
ExpressionCell[{a, b, c}, CellFrame -> True]TextCell["1 2 3", CellFrame -> True]内嵌单元周围边框的位置由内容的大小和 CellFrameMargins 控制:
ExpressionCell[1, CellFrame -> True, CellFrameMargins -> 30]ExpressionCell[{1, ExpressionCell[2, CellFrame -> True], 3}, CellFrame -> True]ExpressionCell[{1, ExpressionCell[2], 3}, CellFrame -> True]属性和关系 (4)
用 CellFrameColor 选项指定单元框的颜色:
ExpressionCell[{1, 2, 3, 4, 5}, "Print", CellFrame -> True, CellFrameColor -> StandardOrange]可通过 CellFrameMargins 指定单元框内的边距:
ExpressionCell[{1, 2, 3, 4, 5}, "Print", CellFrame -> True, CellFrameMargins -> 20]ExpressionCell[{1, 2, 3, 4, 5}, "Print", CellFrame -> 3, CellFrameMargins -> {{20, 20}, {5, 5}}, Background -> StandardGreen]指定具有 CellFrameRoundingRadius 的圆角:
ExpressionCell[{1, 2, 3, 4, 5}, "Print", CellFrame -> True, CellFrameRoundingRadius -> 5]技术笔记
相关指南
-
▪
- 单元样式选项
相关的工作流程
- 在单元周围加上边框
历史
1996年引入 (3.0) | 在以下年份被更新:2022 (13.2) ▪ 2025 (14.2)
文本
Wolfram Research (1996),CellFrame,Wolfram 语言函数,https://reference.wolfram.com/language/ref/CellFrame.html (更新于 2025 年).
CMS
Wolfram 语言. 1996. "CellFrame." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2025. https://reference.wolfram.com/language/ref/CellFrame.html.
APA
Wolfram 语言. (1996). CellFrame. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/CellFrame.html 年
BibTeX
@misc{reference.wolfram_2026_cellframe, author="Wolfram Research", title="{CellFrame}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/CellFrame.html}", note=[Accessed: 08-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_cellframe, organization={Wolfram Research}, title={CellFrame}, year={2025}, url={https://reference.wolfram.com/language/ref/CellFrame.html}, note=[Accessed: 08-August-2026]}