Table Properties using DocumentTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Document Tools : Embedded Components : worksheet/reference/tableproperties

Table Properties using DocumentTools

• 

The table properties control the appearance and behavior of a table in a worksheet or document.

• 

In a document, tables are inserted using the Insert menu. The table is then customized by using the options in the Table Properties dialog. For an overview of inserting and using tables in a document, including working with content in table cells, see Overview of Tables.

• 

You can also access some table properties programmatically, as you can access embedded components. This help page describes the control and use of table properties programmatically.

• 

The Name property is used to reference the table when using the routines from the DocumentTools package. For more information, see the Examples on this page.

 

Table Properties

Examples

Table Properties

• 

Some table properties can be accessed programmatically using commands from the DocumentTools package. The following chart describes these table properties.

  

An x in the G column indicates that the option can be read, that is, retrieved by using the DocumentTools[GetProperty] tool.

  

An x in the S column indicates that the option can be written, that is, set by using the DocumentTools[SetProperty] tool.

Option             G  S  Option Type                                                      
                                        
alignment          x  x  string: left, center or right                                    
id                    x  string                                                           
exterior           x  x  string: all, none, left, top, right, bottom, horizontal, vertical
interior           x  x  string: all, none, group                                         
width              x  x  percentage given as a string                                     
title              x  x  string                                                           
fillcolor          x  x  color                                                            
fillcolor[row]     x  x  color                                                            
fillcolor[row,col] x  x  color                                                            
visible            x  x  true or false                                                    
visible[row]       x  x  true or false                                                    
visible[row,col]   x  x  true or false                                                    
      

  

alignment 

  

Specifies the alignment of the table. By default, the value is left.

  

id 

  

The reference name of the table.

  

exterior 

  

Indicates how exterior borders are drawn. It can be any of the following: all, none, left, top, right, bottom, horizontal, vertical. The default is all.

  

interior 

  

Indicates how interior borders are drawn. It can be all, none, or group. The default is all.

  

width 

  

The width of the table as a percentage of the worksheet's width, e.g. "50%". The default is 100%.

  

title 

  

Specify a caption for the table.

  

fillcolor 

  

Specifies the background color of the table. The color can be given by RGB values (a list of three integers between 0 and 255) or a string representing a color name, for example, [255,0,0] or “Red”. You can also use any color known to ColorTools[ToRGB24]. The default value is [255,255,255] which corresponds to white.

  

fillcolor[row] 

  

Specifies the background color of a row, where row is a positive integer or range.

  

fillcolor[row,column] 

  

Specifies the background color of a cell, where row and column are each a positive integer or range.

  

visible 

  

Specifies if the table is visible. By default, the value is true.

  

visible[row] 

  

Specifies if a row of the table is visible, where row is a positive integer or range.

  

visible[row,column] 

  

Specifies if a cell of the table is visible, where row and column are each a positive integer or range.

• 

For the fillcolor and visible properties, the DocumentTools commands may raise an error in the case of an invalid cell reference or mixed results. For example, consider a 2x2 table where the first row is merged into one cell. Referencing visible(1,1) would be OK but visible(1,2) would raise an error.

• 

For examples demonstrating accessing or changing these properties programmatically, see the Examples below.

Examples

Note: To interact with the examples provided below, open this help page as a worksheet and then execute the worksheet.

When you insert a table, note its name in the Insert Table dialog. You can also check its name in the Table Properties for the table. The name of the table on the right is Table0.

DocumentTools:-GetPropertyTable0,alignment

left

(2.1)

DocumentTools:-SetPropertyTable0,width,75%

Set the background color of one cell.

DocumentTools:-SetPropertyTable0,fillcolor2,1,Orange

Set the background color of the second column to teal.

DocumentTools:-SetPropertyTable0,fillcolor..,2,  0, 128, 128

Return the table to its original state.

DocumentTools:-SetPropertyTable0,width,100%,Table0,fillcolor,255,255,255

 

 

 

 

 

 

 

 

See Also

DocumentTools

DocumentTools[Do]

DocumentTools[GetProperty]

DocumentTools:-Layout:-Table

DocumentTools[SetProperty]

EmbeddedComponents

range

table

worksheet/documenting/table