mlreportgen.dom.Width Class
Namespace: mlreportgen.dom
Object width
Description
Specifies the width of an object, such as an image or a table entry.
The mlreportgen.dom.Width
class is a handle
class.
Creation
Description
Input Arguments
Width of object, specified as 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
— Pixelscm
— Centimetersin
— Inchesmm
— Millimeterspc
— Picaspt
— Points%
— Percent
Properties
Width of object, specified as 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
— Pixelscm
— Centimetersin
— Inchesmm
— Millimeterspc
— Picaspt
— Points%
— Percent
Example: "5pt"
The resulting width of a column depends on the types of widths (absolute or fractional (%) of table width) that you use for each table entry. Setting the width of the entire column, or setting a table entry to resize to fit its contents also affect the resulting column width.
Table Entry Width Setting | Resulting Column Width |
---|---|
Two or more table entries set to different absolute widths | Maximum of the absolute widths |
Two or more table entries set to different fractional widths, expressed as a percent (%) of the table width | Maximum of the fractional widths |
Mixture of table entries set to absolute widths and fractional widths | For PDF output, maximum of the absolute
widths. For all other output formats (for example, Word and HTML), the output application determines the maximum column width to use. |
One or more table entry widths set to
absolute widths or fractional widths, and the
column width set using mlreportgen.dom.TableColSpecGroup | Maximum of the specified table entry widths and the column width |
One or more table entry widths set to
absolute widths or fractional widths, and mlreportgen.dom.ResizeToFitContents set
to true | For PDF output, maximum of the table entry
widths. For all other output formats, maximum of the resized-to-fit table entry widths. |
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
Examples
import mlreportgen.dom.*; doctype = "html"; d = Document("test",doctype); t = Table(magic(5)); t.Style = {Border("inset","crimson","6pt"),... Width("50%")}; t.TableEntriesInnerMargin = "6pt"; t.TableEntriesHAlign = "center"; t.TableEntriesVAlign = "middle"; append(d,t); close(d); rptview("test",doctype);
Version History
Introduced in R2014b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)