mlreportgen.dom.RowHeight class

Package: mlreportgen.dom
Superclasses:

Height of table row

Description

Specifies the height of a table row.

Construction

rowHeightObj = RowHeight() specifies row height to be 1 inch.

rowHeightObj = RowHeight(height) sets a row to the specified height.

rowHeightObj = RowHeight(height,heightType) sets a row to be exactly the specified height or at least the specified height. Applies only to Microsoft® Word documents.

Input Arguments

expand all

Height of table row, in the form valueUnits, where Units is an abbreviation for the units. These abbreviations are valid:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Type of row height measurement, specified as 'exact' for the exact height specified or 'atleast' for the specified height or taller.

Output Arguments

expand all

Row height, represented by an mlreportgen.dom.RowHeight object.

Properties

expand all

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

Tag for the document element, specified as a character vector.

The DOM generates a session-unique tag when it creates the document element. Structure the tag as class:id, where class is the class of the element and id is the value of the Id property. You can specify a tag to replace the generated tag. Specifying your own tag can make it easier to identify where an issue occurred during document generation.

Type of height measure, specified as 'exact' for exactly the specified height or 'atleast' for the specified height or taller.

Height of table row in the form valueUnits, where Units is an abbreviation for the units. These abbreviations are valid:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Examples

collapse all

Create a table with two rows. The first row has a variable height and the second has a fixed maximum height.

import mlreportgen.dom.*;
d = Document('myTableDoc','docx');

t = Table(2);
t.Style = {Border('solid'),RowSep('solid'),ColSep('solid')};
t.Width = '1in';
r1 = TableRow();
r1.Style = {RowHeight('.25in','atleast')};
append(r1,TableEntry(...
    'This row can expand beyond .25 inches'));
append(r1,TableEntry('x'));

r2 = TableRow();
r2.Style = {RowHeight('.25in','exact')};
append(r2,TableEntry...
    ('Truncated text because height is fixed'));
append(r2,TableEntry('x'));

append(t,r1);
append(t,r2);
append(d,t);

close(d);
rptview('myTableDoc','docx');