DocumentTools[Layout]
Table
generate XML for a Table element
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Table( r, opts )
r
-
(optional) ; row content for the Table
opts
(optional) ; one or more keyword options as described below
alignment : identical(left,right,center):=left ; How the Table is aligned within its parent.
captionalignment identical(left,center,right):=left ; How the caption is aligned.
captionposition identical(above,below):=below ; Whether the caption and title are positioned above or below the Table.
drawcaption truefalse:=false ; Whether the caption is visible.
drawtitle truefalse:=false ; Whether the title is visible.
editable : truefalse:=true ; Whether the Table's editable property is set. The default is true.
exterior identical(group,all,none,left,right):=all ; Indicates how exterior borders are shown.
hiddenborderdisplay identical(always,never,worksheet):=worksheet ; Indicates whether hidden borders are displayed upon mouse pointer rollover. The default value is worksheet which specifies that the display will respect the Show/Hide Contents properties of the given Document or Worksheet.
identity : {name,string}; The reference name of the table.
interior identical(group,all,none):=all ; Indicates how internal borders are shown.
order : identical(row,column):=row ; Indicates the order of execution of Table cells.
pagebreak : identical(cell,none,row):=none ; Whether pagebreaks may occur.
postexecute : identical(insert,advance):=advance ; Whether a new execution point will be inserted, or whether the cursor will advance, following execution within a cell.
showinput : truefalse:=true ; Whether input within cells will be visible.
showlabel : truefalse:=false ; Whether equation labels will be shown within cells.
showgroup : truefalse:=false ; Whether execution group boundaries are shown within cells of the Table.
title : string:="" ; A title for the Table.
width : And(realcons,nonnegative):=100.0 ; Indicates the displayed width of the Table as a percentage of the worksheet's width in the case of option widthmode=percentage, or as the number or pixels in the case that option widthmode=pixels. The default is 100% of the displayed worksheet's width.
widthmode : identical(percentage,pixels):=percentage ; Whether the width option's value is interpreted as a percentage of the worksheet's width or as a number of pixels.
The Table command in the Layout Constructors package returns an XML function call which represents a worksheet Table element.
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.
with⁡DocumentTools:with⁡DocumentTools:-Layout:
Executing the Table command produces a function call.
T≔Table⁡Column⁡,Row⁡Cell⁡Some text
T≔_XML_Table⁡interior=all,id=_Table_,hiddenborderdisplay=worksheet,showinput=true,alignment=left,exterior=all,width=100%,showlabel=false,captionalignment=0,title=,drawtitle=false,order=row,drawcaption=false,randomized=false,captionposition=1,showgroup=false,plotalignlists=,pagebreak=none,postexecute=advance,_XML_Table-Column⁡separator=true,weight=100,_XML_Table-Row⁡align=top,separator=true,_XML_Table-Cell⁡columnspan=1,backgroundstyle=0,rowspan=1,fillcolor=[255,255,255],visible=true,_XML_Text-field⁡alignment=centred,style=Text,layout=Normal,Some text
By using additional commands from the Layout Constructors package a nested function call can be produced which represents an entire worksheet.
xml≔Worksheet⁡T:
That XML representation of a worksheet can be inserted directly.
InsertContent⁡xml:
Some text
The Cell constructor is only necessary when some non-default Cell option is wanted, or when a sequence of arguments to Row are intended to be grouped in particular Cells. Arguments to the Row constructor are otherwise automatically wrapped in calls to Cell.
R≔Row⁡Some text.,Cell⁡More text., Yet more text.,fillcolor=gold,Even more text:xml≔Worksheet⁡Table⁡`$`⁡Column⁡,3,R:InsertContent⁡xml:
Some text.
More text. Yet more text.
Even more text
T≔Table⁡title=Title,drawtitle,Row⁡text:InsertContent⁡Worksheet⁡T:
text
T≔Table⁡title=Title,drawtitle,captionalignment=center,Row⁡text:InsertContent⁡Worksheet⁡T:
T≔Table⁡title=Title,drawcaption,drawtitle,captionposition=above,Row⁡text:InsertContent⁡Worksheet⁡T:
T≔Table⁡drawcaption,drawtitle,captionposition=above,Row⁡text:InsertContent⁡Worksheet⁡T:
T≔Table⁡interior=none,exterior=none,Row⁡A,B,Row⁡C,D:InsertContent⁡Worksheet⁡T:
A
B
C
D
T≔Table⁡interior=none,exterior=all,widthmode=pixels,width=300,alignment=left,Row⁡A,B,Row⁡C,D:InsertContent⁡Worksheet⁡T:
T≔Table⁡interior=all,exterior=none,widthmode=percentage,width=40.0,alignment=center,Row⁡A,B,Row⁡C,D:InsertContent⁡Worksheet⁡T:
When the interior borders of a Table are specified to be shown by group then the absence of separators above a row or to the left of a column is revealed.
s≔`$`⁡Some text,4:T≔Table⁡`$`⁡Column⁡,2,`$`⁡Column⁡separator=false,2,interior=group,`$`⁡Row⁡s,2,`$`⁡Row⁡s,separator=false,2:InsertContent⁡Worksheet⁡T:
By default the boundaries of execution groups are not shown in a constructed Table. For the first of the next two examples the boundary of the Group within the Table Cell will not be shown. For the second example the boundary will be shown provided that behavior is enabled for all execution groups (which is not the case for displayed Help pages). Hence the boundary will be shown if the example is executed in a worksheet while that preference is enabled.
C≔Cell⁡Group⁡Input⁡Textfield⁡prompt=> ,style=MapleInput,layout=Normal,alignment=left:T≔Table⁡Row⁡C:InsertContent⁡Worksheet⁡T:
C≔Cell⁡Group⁡Input⁡Textfield⁡prompt=> ,style=MapleInput,layout=Normal,alignment=left:T≔Table⁡showgroup,Row⁡C:InsertContent⁡Worksheet⁡T:
Input regions within a Table can be hidden. The input can be shown, post-insertion, by editing the properties of the Table.
C≔Cell⁡Group⁡Input⁡Textfield⁡prompt=> ,style=MapleInput,layout=Normal,alignment=left,sin(Pi/6);,Output⁡Textfield⁡Equation⁡sin⁡π6:T≔Table⁡showinput=false,showgroup,Row⁡C:InsertContent⁡Worksheet⁡T:
12
The DocumentTools:-Layout:-Table command was introduced in Maple 2015.
For more information on Maple 2015 changes, see Updates in Maple 2015.
The hiddenborderdisplay and identity options were introduced in Maple 2016.
For more information on Maple 2016 changes, see Updates in Maple 2016.
The DocumentTools:-Layout:-Table command was updated in Maple 2020.
The editable option was introduced in Maple 2020.
For more information on Maple 2020 changes, see Updates in Maple 2020.
See Also
Cell
Column
Component Constructors
DocumentTools
InsertContent
Layout Constructors
Row
XMLTools
Download Help Document