mlreportgen.dom.FormalTable class
Package: mlreportgen.dom
Formal table
Description
Defines a formal table, which is a table that has a body and optionally a table header, a
table footer, or both. The table header, body, and footer are
mlreportgen.dom.TableHeader
,
mlreportgen.dom.TableBody
, and
mlreportgen.dom.TableFooter
objects, respectively.
The mlreportgen.dom.FormalTable
class is a handle
class.
Creation
Description
creates an
empty formal table. Use this constructor as the starting point to create a formal table
from scratch.formalTableObj
= FormalTable()
creates an empty formal table having the specified number of columns. formalTableObj
= FormalTable(ncols
)
creates a formal table with the body content specified. The constructor converts basic
MATLAB® types to corresponding DOM objects. For example, the constructor converts
character vectors to formalTableObj
= FormalTable(body
)mlreportgen.dom.Text
objects.
Input Arguments
ncols
— Number of columns in table
numeric value
Number of columns in a table, specified as a numeric value.
Data Types: double
body
— Table body content
two-dimensional numeric array | two-dimensional categorical array | two-dimensional cell array
Table body content, specified as:
A two-dimensional numeric array
A two-dimensional categorical array
A two-dimensional cell array that can contain:
Character vectors
One- or two-dimensional cell array
double
mlreportgen.dom.Text
objectmlreportgen.dom.Paragraph
objectmlreportgen.dom.Image
objectmlreportgen.dom.Table
objectmlreportgen.dom.FormalTable
objectmlreportgen.dom.OrderedList
objectmlreportgen.dom.UnorderedList
objectmlreportgen.dom.ExternalLink
objectmlreportgen.dom.InternalLink
objectmlreportgen.dom.CharEntity
object
styleName
— Style for table
character vector
The style specified by styleName
must be defined in the
template used to create the document that contains this table.
header
— Header content
two-dimensional numeric array | two-dimensional cell array of character vectors
The cell array may contain:
Character vectors
One- or two-dimensional cell array
double
mlreportgen.dom.Text
objectmlreportgen.dom.Paragraph
objectmlreportgen.dom.Image
objectmlreportgen.dom.Table
objectmlreportgen.dom.FormalTable
objectmlreportgen.dom.OrderedList
objectmlreportgen.dom.UnorderedList
objectmlreportgen.dom.ExternalLink
objectmlreportgen.dom.InternalLink
objectmlreportgen.dom.CharEntity
object
footer
— Footer content
two-dimensional numeric array | two-dimensional cell array of character vectors
The cell array may contain:
Character vector
One- or two-dimensional cell array
double
mlreportgen.dom.Text
objectmlreportgen.dom.Paragraph
objectmlreportgen.dom.Image
objectmlreportgen.dom.Table
objectmlreportgen.dom.FormalTable
objectmlreportgen.dom.OrderedList
objectmlreportgen.dom.UnorderedList
objectmlreportgen.dom.ExternalLink
objectmlreportgen.dom.InternalLink
objectmlreportgen.dom.CharEntity
object
Properties
BackgroundColor
— Background color
[]
(default) | character vector | string scalar
Background color, specified as a character vector or string scalar that
consists of a CSS color name (see https://www.w3.org/wiki/CSS/Properties/color/keywords) or a
hexadecimal RGB (truecolor) value in the form
#RRGGBB
.
Setting the BackgroundColor
property adds a corresponding
mlreportgen.dom.BackgroundColor
format object to the
Style
property. Setting the
BackgroundColor
property to an empty value
removes the object.
Example: 'blue'
Example: '#0000ff'
Body
— Table body
mlreportgen.dom.TableBody
object
The table constructor creates a table body object and assigns it to this property when the formal table is constructed. You cannot subsequently set this property. However, you can append content to the table body and set its properties via this property.
Border
— Type of border to draw
'solid'
| 'single'
| 'dashed'
| 'none'
| ...
Type of border to draw, specified as one of the values in the table.
Border Value | Description | Supported Output Types |
---|---|---|
| Dashed line | All output types |
| Line with alternating diagonal dashes and dot | Word |
| Dashed line with a small gap between dashes | Word |
| Dotted line | All output types |
| Line with alternating dots and dashes | Word |
| Line with alternating double dots and a dash | Word |
| Double line | All output types |
| Double wavy line | Word |
| 3-D effect grooved line | HTML and PDF |
| No line The | HTML and PDF |
| 3-D effect line | All output types |
| No line The | All output types |
| 3-D effect line | All output types |
| 3-D effect ridged line | HTML and PDF |
| Single line | Word |
| Single line | HTML and PDF |
| Thick line | Word |
| Dashed line with alternating thick and thin dashes with a large gap | Word |
| Dashed line with alternating thick and thin dashes with a medium gap | Word |
| Dashed line with alternating thick and thin dashes with a small gap | Word |
| Dashed line with alternating thin and thick dashes with a medium gap | Word |
| Dashed line with alternating thin and thick dashes, with a medium gap | Word |
| Dashed line with alternating thin and thick dashes with a small gap | Word |
| Dashed line with alternating thin and thick dashes with a large gap | Word |
| Dashed line with alternating thin and thick dashes with a medium gap | Word |
| Dashed line with alternating thin and thick dashes with a small gap | Word |
| Embossed effect line | Word |
| Engraved effect line | Word |
| Triple line | Word |
| Wavy line | Word |
BorderCollapse
— Collapse borders of adjacent cells into single border (HTML only)
'on'
| 'off'
A value of 'on'
collapses borders of adjacent
cells into a single border. A value of 'off'
keeps
borders of adjacent cells.
BorderColor
— Border color
character vector
Border color, specified as either:
Name of a color. The name must be a CSS color name. See https://www.w3.org/wiki/CSS/Properties/color/keywords.
A hexadecimal RGB (truecolor) value as
#RRGGBB
. For example,#0000ff
is a shade of blue.
BorderWidth
— Table border width
character vector
Table border width, specified in the form valueUnits
,
where Units
is an abbreviation for the units. Valid
abbreviations are:
px
— pixels (default)cm
— centimetersin
— inchesmm
— millimeterspc
— picaspt
— points
Children
— Children of document element
array of DOM objects
Children of this document element, specified as an array of DOM objects. This property is read-only.
ColSep
— Style of line separating columns
character vector
The style of the line separating the columns of a table or table section (header, body,
footer), as specified by an mlreportgen.dom.ColSep
object.
See the description of the Border
property
for a description of the possible values.
ColSepColor
— Color of line separating columns
character vector
Color of line separating columns, specified as either:
Name of a color. The name must be a CSS color name. See https://www.w3.org/wiki/CSS/Properties/color/keywords.
A hexadecimal RGB (truecolor) value as
#RRGGBB
. For example,#0000ff
is a shade of blue.
ColSepWidth
— Width of line separating table columns
character vector
Width of the line separating table columns, in the form valueUnits
.
Use one of these abbreviations for the Units
:
px
— pixels (default)cm
— centimetersin
— inchesmm
— millimeterspc
— picaspt
— points
For example, for a column separator of 3 points, set the ColSepWidth
property
to '3pt'
.
ColSpecGroups
— Properties of group of columns in table
array of mlreportgen.dom.TableColSpecGroup
objects
An array of mlreportgen.dom.TableColSpecGroup
objects
that specifies the width, alignment, and other properties of a group
of columns. The first object applies to the first group of columns,
the second object to the second group, and so on. Specify the number
of columns belonging to each group using the Span
property
of the TableColSpecGroup
object. For example, if
the first object has a span of 2, it applies to the first two columns.
If the second group has a span of 3, it applies to the next three
columns, and so on.
CustomAttributes
— Custom attributes for document element
array of mlreportgen.doc.CustomAttribute
objects
The custom attributes must be supported by the output type of the document to which this document element is appended.
FlowDirection
— Column flow direction
'ltr'
| 'rtl'
Column flow direction, specified as:
'ltr'
— Flow from left to right (column 1 is to the left in the table).'rtl'
— Flow from right to left (column 1 is to the right in the table).
Footer
— Footer for this table
mlreportgen.dom.TableFooter
object
The table constructor creates a table footer object and assigns it to this property when the formal table is constructed. You cannot subsequently set this property. However, you can append content to the table body and set its properties via this property.
HAlign
— Horizontal alignment of this table
'center'
| 'left'
| 'right'
Horizontal alignment of this table, specified as one of these values:
'center'
'left'
'right'
Note
To prevent the overflow of large tables in PDF output, set the
Width
property.
Header
— Table header
mlreportgen.dom.TableHeader
object
The table constructor creates a table header object and assigns it to this property when the formal table is constructed. You cannot subsequently set this property. However, you can append content to the table body and set its properties via this property.
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
KeepWithinPage
— Whether table contents stay on same page
[]
(default) | true
or 1
| false
or 0
Whether the table contents stay on the same page, specified as a numeric or logical 1
(true
) or 0
(false
). The default value is empty and is equivalent to true
.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: logical
OuterLeftMargin
— Left margin (indentation) of document element
character vector
Left indentation in the form valueUnits
. Units
is
an abbreviation for the units. Valid abbreviations are:
px
— pixels (default)cm
— centimetersin
— inchesmm
— millimeterspc
— picaspt
— points
Parent
— Parent of document element
DOM object
Parent of this document element, specified as a DOM object. This property is read-only.
Attributes:
GetAccess | public |
SetAccess | private |
NonCopyable | true |
RowSep
— Style of lines separating rows
character vector
The style of a line separating the rows of a table or table section (header, body, or footer).
See the description of the Border
property
for a description of the possible values.
RowSepColor
— Color of row separator
character vector
You can specify:
Name of a color. The name must be a CSS color name. See https://www.w3.org/wiki/CSS/Properties/color/keywords.
A hexadecimal RGB (truecolor) value as
#RRGGBB
. For example,#0000ff
is a shade of blue.
RowSepWidth
— Width of row separator
character vector
Width of the row separator, specified in the form valueUnits
where Units
is an abbreviation for the units. Valid abbreviations
are:
px
— pixels (default)cm
— centimetersin
— inchesmm
— millimeterspc
— picaspt
— points
Style
— Format for table
array of format objects
Array of format objects (such as Bold
objects)
that specify the format for this table.
This property overrides corresponding formats defined by the
style sheet style specified by the StyleName
property.
StyleName
— Style in document or document part style sheet
character vector
Name of a style specified in the style sheet of the document or document part to which this table is appended
The style that specifies the appearance of this table in the output document, for
formats not specified by Style
property.
You can set the StyleName
property of any formal table section.
Setting StyleName
overrides the style specified by the formal table
itself. However, if you do this for a Word document, you must explicitly specify the
width of each column in a section to ensure that all sections have the same width. Word,
unlike HTML and PDF, has no built-in support for formal tables. To handle this, the DOM
interface represents a formal table as three tables, one for each section, embedded in a
3x1 table.
TableEntriesStyle
— Style to use for table entries
cell array
Cell array of format objects that specify the format for table entries.
TableEntriesInnerMargin
— Inner margin for table entries
character vector
The inner margin is the margin between table cell content and
the cell borders in the form valueUnits
where Units
is
an abbreviation for the units. Valid abbreviations are:
px
— pixels (default)cm
— centimetersin
— inchesmm
— millimeterspc
— picaspt
— points
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
Width
— Table width
character vector
A percentage (for example, '100%'
) of the
page width (minus margins for Word reports) or a number of units of
measurement, having the format valueUnits
. Units
is
an abbreviation for the units. These are valid abbreviations:
px
— pixels (default)cm
— centimetersin
— inchesmm
— millimeterspc
— picaspt
— points
Methods
Public Methods
Method | Purpose |
---|---|
Use
| Append a row of table entries to table |
Append row to table footer | |
Append row to table header | |
Use
| Copy the table |
Version History
Introduced in R2014b
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 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)