枠付きで表示することができるオブジェクトのオプションで,コンテンツの周囲をぴっちり包むように垂直余白を縮めるかどうかを指定する.
ContentPadding
枠付きで表示することができるオブジェクトのオプションで,コンテンツの周囲をぴっちり包むように垂直余白を縮めるかどうかを指定する.
詳細
- ContentPadding->Trueの設定では,枠付きオブジェクトのコンテンツエリアの高さは,たとえ特定の行のコンテンツが行間幅いっぱいに広がっていないとしても,少なくとも1行分の高さである.
- ContentPadding->Falseと設定すると,コンテンツエリアは少なくとも1行の高さに丸められるのではなく,コンテンツにぴったり合うようになる.
- 枠付きオブジェクトの内側の余白はContentPaddingで制御される余白エリアにFrameMarginsの値を加えて設定する.
例題
すべて開く すべて閉じる例 (3)
デフォルトで,ボタンは使われているフォントの行間幅いっぱいに伸びてコンテンツを入れるようになっている:
Button["..."]Button["...", ContentPadding -> False]アセンダーおよびディセンダーがある場合とない場合のラベルの余白を比較する:
Row[Map[Framed[#, ContentPadding -> False, BaselinePosition -> (Baseline -> Baseline)]&, {"Ày", "À", "A", "y", "a"}]]コンテンツエリアがすでに1行分より高いならContentPaddingTrueは何もしない:
Grid[Table[Framed[text, ContentPadding -> c, FrameMargins -> None], {text, {"a", "FractionBox[1, 2]"}}, {c, {False, True}}]]特性と関係 (1)
ContentPaddingTrueは完全なアセンダーおよびディセンダー分の高さを充填する:
Framed[Panel["a"], ContentPadding -> True, FrameMargins -> None]BaselinePositionによってベースラインが動かされた場合は,その分を補うための追加充填が必要になるかもしれない:
Table[Framed[Panel["a", BaselinePosition -> b], ContentPadding -> True, FrameMargins -> None], {b, {Baseline, Top, Bottom}}]関連項目
関連するガイド
テキスト
Wolfram Research (2010), ContentPadding, Wolfram言語関数, https://reference.wolfram.com/language/ref/ContentPadding.html (2021年に更新).
CMS
Wolfram Language. 2010. "ContentPadding." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/ContentPadding.html.
APA
Wolfram Language. (2010). ContentPadding. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ContentPadding.html
BibTeX
@misc{reference.wolfram_2026_contentpadding, author="Wolfram Research", title="{ContentPadding}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/ContentPadding.html}", note=[Accessed: 12-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_contentpadding, organization={Wolfram Research}, title={ContentPadding}, year={2021}, url={https://reference.wolfram.com/language/ref/ContentPadding.html}, note=[Accessed: 12-September-2026]}