 Column - Maple Help

DocumentTools[Layout]

 Column
 generate XML for a Column element Calling Sequence Column( opts ) Parameters

 opts - (optional) ; one or more keyword options as described below Options

 • separator : truefalse:=true ; Indicates whether a vertical separator located to the left of the Column will be visible when the interior borders of the parent Table are set to be shown by group.
 • weight : posint:=100; The relative weight of the corresponding column of a Table. The ratio of the width of a particular column relative to the width of the parent Table corresponds to the ratio of that column's weight to the total weight of all columns. Description

 • The Column command in the Layout Constructors package returns an XML function call which represents a Column element of a worksheet Table.
 • The generated XML may be used with the results of other commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document may be inserted into the current document using the InsertContent command.
 • A Column element does not contain visible content, and serves only as a mechanism for specifying non-default values of the separator or weight options.
 • When constructing a Table use of the Column constructor is only necessary if some non-default value for the separator or weight options is wanted. The Table constructor will otherwise compute the number of columns from the total column span of each Row. Examples

 > $\mathrm{with}\left(\mathrm{DocumentTools}\right):$
 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Layout}\right):$

Executing the Column command produces a function call.

 > $C≔\mathrm{Column}\left(\right)$
 ${C}{≔}{\mathrm{_XML_Table-Column}}{}\left({"separator"}{=}{"true"}{,}{"weight"}{=}{"100"}\right)$ (1)

By using additional commands from the Layout Constructors package a nested function call can be produced which represents an entire worksheet.

 > $T≔\mathrm{Table}\left(C,\mathrm{Row}\left("some text"\right)\right):$
 > $\mathrm{xml}≔\mathrm{Worksheet}\left(T\right):$

That XML representation of a worksheet can be inserted directly.

 > $\mathrm{InsertContent}\left(\mathrm{xml}\right):$

 some text

In the next example the Table constructor computes the total column span of Cells in Rows and automatically generates the Columns within the Table.

 > $\mathrm{R1}≔\mathrm{Row}\left("Some text.",\mathrm{Cell}\left("More text.",\mathrm{columnspan}=2\right),"Yet more text."\right):$
 > $\mathrm{R2}≔\mathrm{Row}\left("A","B","C","D"\right):$
 > $T≔\mathrm{Table}\left(\mathrm{R1},\mathrm{R2}\right):$
 > $c≔\mathrm{select}\left(\mathrm{type},\left[\mathrm{op}\left(T\right)\right],\mathrm{specfunc}\left(\mathrm{anything},\mathrm{_XML_Table-Column}\right)\right)$
 ${c}{≔}\left[{\mathrm{_XML_Table-Column}}{}\left({"separator"}{=}{"true"}{,}{"weight"}{=}{"100"}\right){,}{\mathrm{_XML_Table-Column}}{}\left({"separator"}{=}{"true"}{,}{"weight"}{=}{"100"}\right){,}{\mathrm{_XML_Table-Column}}{}\left({"separator"}{=}{"true"}{,}{"weight"}{=}{"100"}\right){,}{\mathrm{_XML_Table-Column}}{}\left({"separator"}{=}{"true"}{,}{"weight"}{=}{"100"}\right)\right]$ (2)
 > $\mathrm{numelems}\left(c\right)$
 ${4}$ (3)
 > $\mathrm{xml}≔\mathrm{Worksheet}\left(T\right):$
 > $\mathrm{InsertContent}\left(\mathrm{xml}\right):$

 Some text. More text. Yet more text. A B C D

When the interior borders of a Table are specified to be shown by group then the absence of a separator to the left of any Column is revealed.

 > $R≔\mathrm{Row}\left(\mathrm{}\left("Some text",3\right)\right):$
 > $T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Column}\left(\right),\mathrm{Column}\left(\mathrm{separator}=\mathrm{false}\right),\mathrm{interior}=\mathrm{group},R,R\right):$
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

 Some text Some text Some text Some text Some text Some text

The widths of Columns are relative to their weights. The default Column weight is 100. And by default the Table extends to 100% of the displayed worksheet.

 > $T≔\mathrm{Table}\left(\mathrm{Column}\left(\mathrm{weight}=50\right),\mathrm{Column}\left(\right),\mathrm{Column}\left(\mathrm{weight}=200\right),R\right):$
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

 Some text Some text Some text

The same effect is obtained using different weight values, as long as they are in the same relative proportion.

 > $T≔\mathrm{Table}\left(\mathrm{Column}\left(\mathrm{weight}=3\right),\mathrm{Column}\left(\mathrm{weight}=6\right),\mathrm{Column}\left(\mathrm{weight}=12\right),R\right):$
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

 Some text Some text Some text

The relative Column weighting can also be used when the Table is constructed to have a fixed total width in pixels. In the next example the Table has a total width of 300 pixels. The left Column has a weight of 1/6 of the total, and thus a width of 50 pixels. The center Column has a weight of 1/3 and thus a width of 100 pixels. And the right Column has a weight of 1/2 of the total, and thus a width of 150 pixels.

 > T≔\mathrm{Table}\left(\mathrm{Column}\left(\mathrm{weight}=1\right),\mathrm{Column}\left(\mathrm{weight}=2\right),\mathrm{Column}\left(\mathrm{weight}=3\right),\mathrm{alignment}=\mathrm{center},\mathrm{widthmode}=\mathrm{pixels},\mathrm{width}=300,R\right):
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

 Some text Some text Some text

 > Compatibility

 • The DocumentTools:-Layout:-Column command was introduced in Maple 2015.