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

Online Help

All Products    Maple    MapleSim


DocumentTools[Layout]

  

Cell

  

generate XML for a Cell element

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

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

> 

with⁡DocumentTools:

> 

with⁡DocumentTools:-Layout:

Executing the Cell command produces a function call.

> 

C≔Cell⁡Textfield⁡Some text

C≔_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

(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≔Table⁡Column⁡,Row⁡C:

> 

xml≔Worksheet⁡T:

That XML representation of a worksheet can be inserted directly.

> 

InsertContent⁡xml:

Some text

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

> 

C≔Cell⁡Textfield⁡Some text,fillcolor=gold:T≔Table⁡Column⁡,Row⁡C:InsertContent⁡Worksheet⁡T:

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≔InlinePlot⁡plot3d⁡x2⁢sin⁡y,x=−1..1,y=−2⁢π..2⁢π,axes=none:C≔Cell⁡Textfield⁡P,fillcolor=black:T≔Table⁡Column⁡,Row⁡C,widthmode=pixels,width=300,alignment=center:InsertContent⁡Worksheet⁡T:

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

> 

C≔Cell⁡Textfield⁡AgTy,padding=50:T≔Table⁡Column⁡,Row⁡C:InsertContent⁡Worksheet⁡T:

AgTy

> 

C≔Cell⁡Textfield⁡AgTy,padding=0:T≔Table⁡Column⁡,Row⁡C:InsertContent⁡Worksheet⁡T:

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.

> 

C1≔Cell⁡Textfield⁡Some text:C2≔Cell⁡Textfield⁡style=TwoDimOutput,Equation⁡sqrt⁡exp⁡−t2πΓ⁡x:T≔Table⁡Column⁡,Column⁡,Row⁡C1,C2,Row⁡C1,C2,align=center:InsertContent⁡Worksheet⁡T:

Some text

ⅇ−t2πΓ⁡x

Some text

ⅇ−t2πΓ⁡x

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

> 

C1≔Cell⁡Textfield⁡Some text,alignment=right:

> 

C2≔Cell⁡Table⁡Column⁡,Row⁡Cell⁡,widthmode=pixels,width=50,alignment=center:

> 

C3≔Cell⁡Textfield⁡Other text,alignment=left:

> 

T≔Table⁡Column⁡,Column⁡,Column⁡,Row⁡C1,C2,C3:InsertContent⁡Worksheet⁡T:

Some text

 

Other text

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

> 

T≔Table⁡Column⁡,Column⁡,Column⁡,Row⁡Cell⁡columnspan=2,Cell⁡:InsertContent⁡Worksheet⁡T:

 

 

Parsing of Cells is done Row by Row.

> 

T≔Table⁡Column⁡,Column⁡,Column⁡,widthmode=pixels,width=90,alignment=center,Row⁡Cell⁡A,columnspan=2,Cell⁡A,rowspan=2,Row⁡Cell⁡B,rowspan=2,Cell⁡B,Row⁡Cell⁡C,columnspan=2:InsertContent⁡Worksheet⁡T:

A

A

B

B

C

> 

T≔Table⁡Column⁡,Column⁡,Column⁡,widthmode=pixels,width=90,alignment=center,Row⁡Cell⁡A,rowspan=2,Cell⁡A,columnspan=2,Row⁡Cell⁡B,Cell⁡B,rowspan=2,Row⁡Cell⁡C,columnspan=2:InsertContent⁡Worksheet⁡T:

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.

See Also

Component Constructors

DocumentTools

InsertContent

Layout Constructors

XMLTools