Contenido principal

mlreportgen.dom.TableEntry Class

Namespace: mlreportgen.dom

Description

Use an object of the mlreportgen.dom.TableEntry class to specify the content and style of a table entry.

To see what DOM objects you can append an mlreportgen.dom.TableEntry object to, see Append mlreportgen.dom.TableEntry object to DOM class object.

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

Creation

Description

entryObj = TableEntry creates an empty table entry.

entryObj = TableEntry(text) creates a table entry using the specified text. The constructor creates a text object and appends it to the table entry. In Microsoft® Word and PDF output, text in a table entry is wrapped in a paragraph because Word and PDF do not permit unwrapped text in table entries. In HTML output, the text is not wrapped in a paragraph.

entryObj = TableEntry(text,styleName) creates a table entry containing specified text using the specified style.

entryObj = TableEntry(domObj) creates a table entry containing domObj, where domObj is a DOM object such as a mlreportgen.dom.Paragraph object.

Input Arguments

expand all

Text for the table entry, specified as a character vector or string scalar.

Data Types: char | string

Text for the table entry, specified as an mlreportgen.dom.Text object.

The style specified by styleName must be defined in the template of the document to which this table is appended.

Properties

expand all

Type of border to draw, specified as one of these values:

Border StyleDescriptionSupported in Microsoft WordSupported in HTML and PDF
"dashed"Dashed lineyesyes
"dashdotstroked"Line with alternating diagonal dashes and dotyesyes
"dashsmallgap"Dashed line with a small gap between dashesyesyes
"dotted"Dotted lineyesyes
"dotdash"Line with alternating dots and dashesyesno
"dotdotdash"Line with alternating double dots and a dashyesno
"double"Double lineyesyes
"doublewave"Double wavy lineyesno
"groove"3-D effect grooved linenoyes
"hidden"

No line

When there is a conflicting border style, the "hidden" border style takes precedence over the conflicting border style, which results in no line displaying.

noyes
"inset"3-D effect linenoyes
"none"

No line

When there is a conflicting border style, the conflicting border style takes precedence over "none", which results in the conflicting border style displaying.

yesyes
"outset"3-D effect lineyesyes
"ridge"3-D effect ridged linenoyes
"single"Single lineyesyes
"solid"Single linenoyes
"thick"Thick lineyesno
"thickthinlargegap"Dashed line with alternating thick and thin dashes with a large gapyesno
"thickthinmediumgap"Dashed line with alternating thick and thin dashes with a medium gapyesno
"thickthinsmallgap"Dashed line with alternating thick and thin dashes with a small gapyesno
"thinthicklargegap"Dashed line with alternating thin and thick dashes with a large gapyesno
"thinthickmediumgap"Dashed line with alternating thin and thick dashes with a medium gapyesno
"thinthicksmallgap"Dashed line with alternating thin and thick dashes with a small gapyesno
"thinthickthinlargegap"Dashed line with alternating thin and thick dashes with a large gapyesno
"thinthickthinmediumgap"Dashed line with alternating thin and thick dashes with a medium gapyesno
"thinthickthinsmallgap"Dashed line with alternating thin and thick dashes with a small gapyesno
"threedemboss"Embossed effect lineyesno
"threedengrave"Engraved effect lineyesno
"triple"Triple lineyesno
"wave"Wavy lineyesno

Note

For Microsoft Word reports, when you assign an mlreportgen.dom.Border object to the Style property of an mlreportgen.dom.TableHeaderEntry, mlreportgen.dom.TableEntry, or mlreportgen.dom.HorizontalRule object, the reporter does not support "inset" or "outset" styles for this property.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Border color, specified as a character vector or string scalar that contains a CSS color name, hexadecimal RGB value, or decimal RGB value.

FormatValue
CSS color nameSpecify a CSS color name. For a list of CSS color names, see https://www.w3.org/wiki/CSS/Properties/color/keywords.
Hexadecimal RGB valueUse the format "#RRGGBB". Use # as the first character and two-digit hexadecimal numbers for the red, green, and blue values. You can use uppercase or lowercase letters.
Decimal RGB color valueUse the format "rgb(r,g,b)", where r, g, and b are comma-separated positive integers that specify the red, green, and blue values, respectively. Each value range must be between 0 and 255.

Example: "red" specifies a red color using a CSS color name.

Example: "#0000ff" specifies a blue color using a hexadecimal RGB value.

Example: "rgb(128,0,128)" specifies a purple color using a decimal RGB color value.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Table border width, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "10px" specifies 10 pixels. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

You can also specify pixels by omitting the unit. For example, "5" specifies 5 pixels.

Example: "2pt"

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Number of table columns spanned by the table entry, specified as a double.

Attributes:

GetAccess
public
SetAccess
public

Data Types: double

Inner margin, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "10px" specifies 10 pixels. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

You can also specify pixels by omitting the unit. For example, "5" specifies 5 pixels.

Example: "5px"

Setting this property appends an InnerMargin format to the Style format array of this table entry.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Number of table rows spanned by the table entry, specified as a double.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: double

Vertical alignment table cell content, specified as one of these values:

  • "top"

  • "bottom"

  • "middle"

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Name of stylesheet-defined style, specified as a character vector or string scalar. The style name is the name of a style specified in the style sheet of the document or document part to which this element is appended. The specified style defines the appearance of this element in the output document unless the formats specified by the Style property of this element override it. To learn more about using style sheets, see Use Style Sheet Styles.

Note

Microsoft Word reports ignore style names that are not defined in the document template. For more information on Microsoft Word templates, see Templates for DOM API Report Programs.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Format specification for this document element object, specified as a cell 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:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: cell

Custom attributes of the 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:

GetAccess
public
SetAccess
public
NonCopyable
true

Parent of this object, specified as a document element object. A document element must have only one parent.

Attributes:

GetAccess
public
SetAccess
private
NonCopyable
true

Children of this object, specified as an array of document element objects. This property contains the document element objects appended using the append method.

Attributes:

GetAccess
public
SetAccess
private
NonCopyable
true

Tag, 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. Use this value to help identify where an issue occurs during document generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Object identifier, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Methods

expand all

Tips

  • To specify formatting for all table entries in a table, adjust the TableEntriesStyle property of the mlreportgen.dom.Table or mlreportgen.dom.FormalTable object. For example, you can set border formatting.

    import mlreportgen.dom.*
    t = Table(magic(5));
    t.TableEntriesStyle = {Border("solid","black","1")};

    Properties you set for a mlreportgen.dom.TableEntry object take precedence over mlreportgen.dom.TableEntriesStyle format objects.

  • To avoid table formatting errors, create table rows that span the same number of cells, regardless of the number of table entries. For example, the first row in this table has two table entries. The first entry, Winter, spans two columns and the second entry, Spring, spans one column. The second row has three entries that each span one column.

    Table with two rows that have different numbers of cells but span the same number of columns.

    If you modify only the second row of the table so that the first two entries, Jaunary and February, each span two columns, and the last entry spans one column, the table format changes.

    The first row in the table has two entries. The second row has three entries and the last entry spans two rows.

  • When you include large content in a table entry, the table may not fit on a report page. If a table cannot fit on a DOCX report page, Microsoft Word cannot open the report. To ensure that your table fits in a DOCX report, set the width and height of table entries with large content. To set the width, use the mlreportgen.dom.Width class. To set the height, use the mlreportgen.dom.Height class. To avoid deleting existing formats, concatenate the new table entry style with the existing style:

    te = TableEntry(domObj);
    te.Style = [te.Style, {Width("1in"), Height("1in")}];
    append(row,te);
    To apply the format to all table entries in a table, use the TableEntriesStyle property of the table object.

Version History

Introduced in R2014a