Column

Column[{expr1,expr2,}]

is an object that formats with the expri arranged in a column, with expr1 above expr2, etc.

Column[list,alignment]

aligns each element horizontally in the specified way.

Column[list,alignment,spacing]

leaves the specified number of x-heights of spacing between successive elements.

Details and Options

  • Possible alignments are:
  • Centercentered
    Leftleft justified (default)
    Rightright justified
    "c" align on the character "c"
    {h,v}separate horizontal and vertical alignment
  • Column[] formats as a column in StandardForm, TraditionalForm, and OutputForm.
  • In InputForm, Column[] formats literally as Column[].
  • First[col] extracts the list that makes up a column.
  • The expri can be expressions of any kind, including graphics and controls.
  • You can enter text as an element of a Column by giving it as a string. You can use Text["string"] or Style["string","style"] to specify a particular style.
  • The following options can be given:
  • Alignment {Left,Baseline}horizontal and vertical alignment of items
    Background Nonewhat background colors to use
    BaselinePosition Automaticwhat to align with a surrounding text baseline
    BaseStyle{}base style specifications for the column
    DefaultElement"[Placeholder]"what element to insert in an empty item
    Dividers {}where to draw divider lines in the column
    Frame Nonewhere to draw frames in the column
    FrameStyle Automaticstyle to use for frames
    ItemSize Automaticwidth and height of each item
    ItemStyle Noneindividual styles for items
    Spacings Automatichorizontal and vertical spacings
  • Common settings for Frame include:
  • Noneno frame
    Trueframe around the whole column
    Allframe around every item in the column
  • Column[list,alignment] is equivalent to Column[list,Alignment->alignment].
  • Column[list,alignment,spacing] corresponds to the setting Spacings->spacing.
  • Background and ItemStyle can be lists giving settings for each item in the column.
  • Settings for the options Alignment, Background, Frame, ItemSize, and ItemStyle can be given as follows to apply separately to successive items in the column:
  • {s1,s2,,sn}use s1 through sn, then use defaults
    {{c}}use c in all cases
    {{c1,c2}}alternate between c1 and c2
    {{c1,c2,}}cycle through all ci
    {s,{c}}use s, then repeatedly use c
    {s1,{c},sn}use s1, then repeatedly use c, but use sn at the end
    { s 1 , s 2 , , { c 1 , c 2 , }, s m , , s n }
    use the first sequence of si at the beginning, then cyclically use the ci, then use the last sequence of si at the end
    {s1,s2,,{},sm,,sn}use the first sequence of si at the beginning and the last sequence at the end
    {i1->v1,i2->v2,}specify what to use at positions ik
    {spec,rules}use rules to override specifications in spec
  • With settings of the form {s1,s2,,{},sm,,sn}, if there are more si specified than items in the column, si from the beginning are used for the first items, and ones from the end are used for the last items.
  • Settings such as Alignment, Background, and Frame can effectively be specified for individual items in the column using Item.
  • With the default setting ItemSize->Automatic, Column will break elements across multiple lines if necessary.
  • Column will not change the size of graphics or other objects that have explicit ImageSize settings.
  • For a column of n elements, Dividers and Spacings can specify settings for the n+1 gaps between elements, starting before the first element and ending after the last element.
  • Settings for Dividers and Spacings can have the following forms:
  • specapply spec to all gaps between items
    {specx,specy}apply speci to successive horizontal and vertical gaps
  • The speci can have the same forms as for Alignment, Background, and other item-oriented options.
  • The following settings can be used for BaselinePosition:
  • Axisaxis of the middle row in the column (default)
    Baselinebaseline of the middle row in the column
    Bottombottom of the whole column
    Centerhalfway from top to bottom
    Toptop of the whole column
    {i,pos}position pos in element i
  • The settings for BaseStyle are appended to the default style typically given by the "Column" style in the current stylesheet.

Examples

open allclose all

Basic Examples  (2)

Display as a column:

Center each element:

Scope  (4)

Add a frame around the column:

Set the background:

Use alternating background colors:

Set the item size for line breaking:

Options  (19)

Alignment  (1)

Align within the column:

Background  (1)

Change the overall background color:

Change the background color of an individual row:

Alternate the background color:

BaselinePosition  (1)

Align the column with surrounding text:

Dividers  (5)

Draw all dividers:

Only draw exterior dividers:

Draw only interior dividers:

Draw custom dividers:

Use negative-position indices:

Draw outer column dividers:

Use negative-position indices:

Frame  (3)

Frame all elements:

Frame only the exterior:

Frame specific elements:

FrameStyle  (1)

Set the style for the frame:

ItemSize  (2)

Control the size of an item and possibly force linewrapping:

By setting ItemSize, the content will have a line break:

ItemStyle  (4)

Change the overall style:

Change the style for a specific element:

Dynamically change the element being styled:

Dynamically change the style of a specific element:

Spacings  (1)

Change the spacing between elements:

Properties & Relations  (1)

Column is a special case of Grid:

Wolfram Research (2007), Column, Wolfram Language function, https://reference.wolfram.com/language/ref/Column.html.

Text

Wolfram Research (2007), Column, Wolfram Language function, https://reference.wolfram.com/language/ref/Column.html.

CMS

Wolfram Language. 2007. "Column." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Column.html.

APA

Wolfram Language. (2007). Column. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Column.html

BibTeX

@misc{reference.wolfram_2024_column, author="Wolfram Research", title="{Column}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Column.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_column, organization={Wolfram Research}, title={Column}, year={2007}, url={https://reference.wolfram.com/language/ref/Column.html}, note=[Accessed: 22-November-2024 ]}