DocumentTools[Layout]
Column
generate XML for a Column element
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Column( opts )
opts
-
(optional) ; one or more keyword options as described below
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.
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.
with⁡DocumentTools:
with⁡DocumentTools:-Layout:
Executing the Column command produces a function call.
C≔Column⁡
C≔_XML_Table-Column⁡separator=true,weight=100
By using additional commands from the Layout Constructors package a nested function call can be produced which represents an entire worksheet.
T≔Table⁡C,Row⁡some text:
xml≔Worksheet⁡T:
That XML representation of a worksheet can be inserted directly.
InsertContent⁡xml:
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.
R1≔Row⁡Some text.,Cell⁡More text.,columnspan=2,Yet more text.:
R2≔Row⁡A,B,C,D:
T≔Table⁡R1,R2:
c≔select⁡type,op⁡T,specfunc⁡anything,`_XML_Table-Column`
c≔_XML_Table-Column⁡separator=true,weight=100,_XML_Table-Column⁡separator=true,weight=100,_XML_Table-Column⁡separator=true,weight=100,_XML_Table-Column⁡separator=true,weight=100
numelems⁡c
4
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≔Row⁡`$`⁡Some text,3:
T≔Table⁡Column⁡,Column⁡,Column⁡separator=false,interior=group,R,R:
InsertContent⁡Worksheet⁡T:
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≔Table⁡Column⁡weight=50,Column⁡,Column⁡weight=200,R:
The same effect is obtained using different weight values, as long as they are in the same relative proportion.
T≔Table⁡Column⁡weight=3,Column⁡weight=6,Column⁡weight=12,R:
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≔Table⁡Column⁡weight=1,Column⁡weight=2,Column⁡weight=3,alignment=center,widthmode=pixels,width=300,R:
The DocumentTools:-Layout:-Column command was introduced in Maple 2015.
For more information on Maple 2015 changes, see Updates in Maple 2015.
See Also
Cell
Component Constructors
DocumentTools
InsertContent
Layout Constructors
Row
XMLTools
Download Help Document