mlreportgen.dom.Width class
Package: 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
— pixels (default)cm
— centimetersin
— inchesmm
— millimeterspc
— picaspt
— points%
— percent
Properties
Id
— ID for this document element
character vector | string scalar
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.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char
| string
Tag
— Tag for this document element
character vector | string scalar
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 the Id
property of the object. Specifying your own tag value can
help you to identify where an issue occurred during document generation.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char
| string
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
— pixels (default)cm
— centimetersin
— inchesmm
— millimeterspc
— picaspt
— points%
— percent of table width
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. |
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
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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)