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
value
— Width of object
character vector
Width of object, such as an image or a table entry, specified in
the form valueUnits
, where
Units
is an abbreviation for the units.
These abbreviations are valid:
px
— pixelscm
— centimetersin
— inchesmm
— millimeterspc
— picaspt
— points%
— percent
Properties
Value
— Width of object
character vector
Width of object, such as an image or a table entry, specified in the
form valueUnits
, where Units
is
an abbreviation for the units. These abbreviations are valid:
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
— Tag for mlreportgen.dom.Width
object
character vector | string scalar
Tag for the mlreportgen.dom.Width
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
Id
— Object identifier for mlreportgen.dom.Width
object
character vector | string scalar
Object identifier for the mlreportgen.dom.Width
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
Set Width and Other Formats for a Table
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)