Main Content

mlreportgen.dom.TableColSpecGroupclass

Package:mlreportgen.dom

Define style for group of table columns

Description

Use an object of themlreportgen.dom.TableColSpecGroupclass to define the style for a group of adjacent table columns. To override the style specified by aTableColSpecGroupobject for one or more adjacent columns of the group, use anmlreportgen.dom.TableColSpecobject.

Themlreportgen.dom.TableColSpecGroupclass is ahandleclass.

Class Attributes

ConstructOnLoad
true
HandleCompatible
true

For information on class attributes, seeClass Attributes.

Creation

Description

example

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

Properties

expand all

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

Column formatting, specified as an array of format objects. Format objects that do not apply to aTableColSpecGroupobject are ignored.

Styles for column subgroups, specified as an array ofmlreportgen.dom.TableColSpecobjects. The firstmlreportgen.dom.TableColSpecobject applies to the first subgroup of the group of columns specified by thisTableColSpecGroupobject. The secondTableColSpecobject applies to the next subgroup, and so on. For example, suppose that thisTableColSpecGroupobject applies to the first five columns of the table and that the firstTableColSpecobject in theColSpecsproperty has a span of two. The firstTableColSpecobject applies to the first and second columns of the table.

The style specified by aTableColSpecobject in theColSpecsproperty overrides the style specified by theStyleproperty of thisTableColSpecGroupobject.

This property is ignored.

Custom attributes of this document element, specified as an array ofmlreportgen.dom.CustomAttributeobjects. The custom attributes must be supported by the report output format.

This property is ignored and is read-only.

This property is ignored and is read-only.

Tag for this document element, specified as a character vector or string scalar.

The DOM 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 theIdproperty of the object. Specifying your own tag value can help you to identify where an issue occurred during document generation.

ID for this document element, specified as a character vector or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Examples

collapse all

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

importmlreportgen.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);
Introduced in R2014b