Cell - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

DocumentTools[Layout]

 Cell
 generate XML for a Cell element

 Calling Sequence Cell( c, opts )

Parameters

 c - (optional) ; content for the Cell opts - (optional) ; one or more keyword options as described below

Options

 • backgroundstyle : nonnegint:=0 ; Specifies whether the fillcolor option will be respected (1) or ignored (0).
 • columnspan : nonnegint:=1 ; Specifies how many columns to the right the Cell will span.
 • fillcolor : {list(nonnegint),symbol,string}:=[255,255,255] ; Specifies the background color of the Cell. The passed value can be either a named color or a list of three integers each between 0 and 255. A list of nonnegative integers is interpreted as RGB values in a 24bit 3-channel color space. The default value is [255,255,255] which corresponds to white.
 • padding : nonnegint:=NULL ; The number of pixels of padding for the Cell.
 • rowspan : nonnegint:=1 ; Specifies how many rows downwards the Cell will span.
 • visible : truefalse:=true ; Specifies whether the cell is visible or hidden

Description

 • The Cell command in the Layout Constructors package returns an XML function call which represents a Cell 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.

Examples

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

Executing the Cell command produces a function call.

 > $C≔\mathrm{Cell}\left(\mathrm{Textfield}\left("Some text"\right)\right)$
 {C}{≔}{\mathrm{_XML_Table-Cell}}{}\left({"columnspan"}{=}{"1"}{,}{"backgroundstyle"}{=}{"0"}{,}{"rowspan"}{=}{"1"}{,}{"fillcolor"}{=}{"\left[255,255,255\right]"}{,}{"visible"}{=}{"true"}{,}{\mathrm{_XML_Text-field}}{}\left({"alignment"}{=}{"centred"}{,}{"style"}{=}{"Text"}{,}{"layout"}{=}{"Normal"}{,}{"Some text"}\right)\right) (1)

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

The following example produces a Table, T consisting of a single column and a single row. The contents of the row is C, the Cell element created above.

 > $T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Row}\left(C\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

The next example illustrates using a color to fill the background of a Cell.

 > $C≔\mathrm{Cell}\left(\mathrm{Textfield}\left("Some text"\right),\mathrm{fillcolor}="gold"\right):$$T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Row}\left(C\right)\right):$$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

 Some text

Using a fill color on a Cell is an effective way to show a 3D plot with a black background. The next example uses the InlinePlot element constructor for the content of the Cell.

 > $P≔\mathrm{InlinePlot}\left(\mathrm{plot3d}\left({x}^{2}\mathrm{sin}\left(y\right),x=-1..1,y=-2\mathrm{Pi}..2\mathrm{Pi},\mathrm{axes}=\mathrm{none}\right)\right):$$C≔\mathrm{Cell}\left(\mathrm{Textfield}\left(P\right),\mathrm{fillcolor}="black"\right):$T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Row}\left(C\right),\mathrm{widthmode}=\mathrm{pixels},\mathrm{width}=300,\mathrm{alignment}=\mathrm{center}\right):$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

The content of the Cell can be padded by a specified number of pixels.

 > $C≔\mathrm{Cell}\left(\mathrm{Textfield}\left("AgTy"\right),\mathrm{padding}=50\right):$$T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Row}\left(C\right)\right):$$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

 AgTy

 > $C≔\mathrm{Cell}\left(\mathrm{Textfield}\left("AgTy"\right),\mathrm{padding}=0\right):$$T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Row}\left(C\right)\right):$$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

 AgTy

Vertical alignment within a Cell is a property of its parent Row, for which the default is top alignment. Note the difference in alignment between the two Cells on the left.

 > $\mathrm{C1}≔\mathrm{Cell}\left(\mathrm{Textfield}\left("Some text"\right)\right):$$\mathrm{C2}≔\mathrm{Cell}\left(\mathrm{Textfield}\left(\mathrm{style}=\mathrm{TwoDimOutput},\mathrm{Equation}\left(\frac{\sqrt{{ⅇ}^{-\frac{{t}^{2}}{\mathrm{Pi}}}}}{\mathrm{GAMMA}\left(x\right)}\right)\right)\right):$T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Column}\left(\right),\mathrm{Row}\left(\mathrm{C1},\mathrm{C2}\right),\mathrm{Row}\left(\mathrm{C1},\mathrm{C2},\mathrm{align}=\mathrm{center}\right)\right):$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

 Some text $\frac{\sqrt{{{ⅇ}}^{{-}\frac{{{t}}^{{2}}}{{\mathrm{\pi }}}}}}{{\mathrm{\Gamma }}{}\left({x}\right)}$ Some text $\frac{\sqrt{{{ⅇ}}^{{-}\frac{{{t}}^{{2}}}{{\mathrm{\pi }}}}}}{{\mathrm{\Gamma }}{}\left({x}\right)}$

Horizontal alignment within a Cell is a property of the content (child element) of the Cell.

 > \mathrm{C1}≔\mathrm{Cell}\left(\mathrm{Textfield}\left("Some text",\mathrm{alignment}=\mathrm{right}\right)\right):
 > \mathrm{C2}≔\mathrm{Cell}\left(\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Row}\left(\mathrm{Cell}\left(\right)\right),\mathrm{widthmode}=\mathrm{pixels},\mathrm{width}=50,\mathrm{alignment}=\mathrm{center}\right)\right):
 > \mathrm{C3}≔\mathrm{Cell}\left(\mathrm{Textfield}\left("Other text",\mathrm{alignment}=\mathrm{left}\right)\right):
 > $T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Column}\left(\right),\mathrm{Column}\left(\right),\mathrm{Row}\left(\mathrm{C1},\mathrm{C2},\mathrm{C3}\right)\right):$$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

Some text

Other text

A cell may span more than a single Column or Row of a Table.

 > $T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Column}\left(\right),\mathrm{Column}\left(\right),\mathrm{Row}\left(\mathrm{Cell}\left(\mathrm{columnspan}=2\right),\mathrm{Cell}\left(\right)\right)\right):$$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

Parsing of Cells is done Row by Row.

 > T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Column}\left(\right),\mathrm{Column}\left(\right),\mathrm{widthmode}=\mathrm{pixels},\mathrm{width}=90,\mathrm{alignment}=\mathrm{center},\mathrm{Row}\left(\mathrm{Cell}\left("A",\mathrm{columnspan}=2\right),\mathrm{Cell}\left("A",\mathrm{rowspan}=2\right)\right),\mathrm{Row}\left(\mathrm{Cell}\left("B",\mathrm{rowspan}=2\right),\mathrm{Cell}\left("B"\right)\right),\mathrm{Row}\left(\mathrm{Cell}\left("C",\mathrm{columnspan}=2\right)\right)\right):$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

 A A B B C

 > T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Column}\left(\right),\mathrm{Column}\left(\right),\mathrm{widthmode}=\mathrm{pixels},\mathrm{width}=90,\mathrm{alignment}=\mathrm{center},\mathrm{Row}\left(\mathrm{Cell}\left("A",\mathrm{rowspan}=2\right),\mathrm{Cell}\left("A",\mathrm{columnspan}=2\right)\right),\mathrm{Row}\left(\mathrm{Cell}\left("B"\right),\mathrm{Cell}\left("B",\mathrm{rowspan}=2\right)\right),\mathrm{Row}\left(\mathrm{Cell}\left("C",\mathrm{columnspan}=2\right)\right)\right):$\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

 A A B B C

Compatibility

 • The DocumentTools:-Layout:-Cell command was introduced in Maple 2015.
 • For more information on Maple 2015 changes, see Updates in Maple 2015.
 • The DocumentTools:-Layout:-Cell command was updated in Maple 2016.
 • The visible option was introduced in Maple 2016.
 • For more information on Maple 2016 changes, see Updates in Maple 2016.