Main Content

mlreportgen.dom.TableColSpecGroup Class

Namespace: mlreportgen.dom

Define style for group of table columns

Description

Use an object of the mlreportgen.dom.TableColSpecGroup class to define the style for a group of adjacent table columns. To override the style specified by a TableColSpecGroup object for one or more adjacent columns of the group, use an mlreportgen.dom.TableColSpec object.

The mlreportgen.dom.TableColSpecGroup class is a handle class.

Class Attributes

ConstructOnLoad
true
HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

colSpecGroupObj = mlreportgen.dom.TableColSpecGroup creates a column style specification that spans an entire table.

example

Properties

expand all

Number of adjacent table columns to which the column formatting applies, specified as an integer. If the value of the Span property is empty ([]), the formatting applies to all of the columns in the table.

Styles for column subgroups, specified as an array of mlreportgen.dom.TableColSpec objects. The first mlreportgen.dom.TableColSpec object applies to the first subgroup of the group of columns specified by this TableColSpecGroup object. The second TableColSpec object applies to the next subgroup, and so on. For example, suppose that this TableColSpecGroup object applies to the first five columns of the table and that the first TableColSpec object in the ColSpecs property has a span of two. The first TableColSpec object applies to the first and second columns of the table.

The style specified by a TableColSpec object in the ColSpecs property overrides the style specified by the Style property of this TableColSpecGroup object.

The class ignores this property.

Attributes:

NonCopyable
true

Format specification for this document element object, specified as an array of DOM format objects. The formats specified by this property override corresponding formats specified by the StyleName property of this element. Formats that do not apply to this document element object are ignored.

Attributes:

NonCopyable
true

Custom attributes of this document element, specified as an array of mlreportgen.dom.CustomAttribute objects. The custom attributes must be supported by the output format of the document element to which this object is appended.

Attributes:

NonCopyable
true

The class ignores this property.

Attributes:

SetAccess
private
NonCopyable
true

The class ignores this property.

Attributes:

SetAccess
private
NonCopyable
true

Tag for the mlreportgen.dom.TableColSpecGroup object, specified as a character vector or string scalar. The DOM API generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Specify your own tag value to help you identify where to look when an issue occurs during document generation.

Attributes:

NonCopyable
true

Data Types: char | string

Object identifier for the mlreportgen.dom.TableColSpecGroup object, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object. You can specify your own value for Id.

Attributes:

NonCopyable
true

Data Types: char | string

Examples

collapse all

Make the first column of a table green and the remaining columns red. Use a TableColSpecGroup object to specify the color of all of the table columns and use a TableColSpec object to override the color for the first column.

import mlreportgen.dom.*
d = Document('mydoc','docx');
append(d,'Table');
     
grps(1) = TableColSpecGroup;
grps(1).Style = {Color('red')};
grps(1).Span = 5;
specs(1) = TableColSpec;
specs(1).Style = {Color('green')};
grps(1).ColSpecs = specs;
table = Table(magic(5));
table.ColSpecGroups = grps;

append(d,table);

close(d);
rptview(d);

Version History

Introduced in R2014b