Alignment
is an option which specifies how the contents of a displayed object should be aligned within the available area in the object.
Details
- The following settings can be given:
-
Automatic default alignment based on environment Left left aligned Right right aligned Top top aligned Bottom bottom aligned Baseline baseline aligned Center centered {h,v} separate horizontal and vertical alignments x aligned at position x from (left) to (right) {x,y} aligned at horizontal and vertical positions x and y from to "c" aligned on the specified character in a grid - Alignment->Center is equivalent to Alignment->{Center,Center}.
- In Alignment->{x,y}, y values run from at the bottom to at the top.
- Alignment->spec indicates that the spec element of an object should align with the spec element of whatever object contains it.
- With Alignment->Automatic, the alignment for the contents of an object will be based on the alignment specified for whatever object contains it.
- General settings for Alignment in Grid, Dataset and related constructs can be given as:
-
spec apply spec to all items {specx} apply horizontal alignments specx at successive horizontal positions {specx,specy} apply horizontal alignments specx and vertical alignments specy at successive horizontal and vertical positions {specx,specy,rules} also allow explicit rules for individual i,j elements - The speck can have the following forms:
-
{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 {s1,s2,…,{c1,c2,…},sm,…,sn} 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 across the grid, si from the beginning are used for the first items, and ones from the end are used for the last items.
- Rules of the form {{imin,imax},{jmin,jmax}}->v can be used to specify alignments for regions of a grid.
Examples
open allclose allBasic Examples (3)
Align elements around the center of the grid:
Different predefined alignment options for Button:
Scope (3)
Generalizations & Extensions (2)
Properties & Relations (2)
Alignment affects the alignment of the entire construct, but not individual lines of text:
TextAlignment is used to align the individual lines of text in a string or expression:
It is often desirable to set both alignments to the same value:
Alignment determines how cells affected by a narrow PageWidth align:
abcText
Wolfram Research (2007), Alignment, Wolfram Language function, https://reference.wolfram.com/language/ref/Alignment.html.
CMS
Wolfram Language. 2007. "Alignment." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Alignment.html.
APA
Wolfram Language. (2007). Alignment. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Alignment.html