mlreportgen.dom.HorizontalRule Class
Namespace: mlreportgen.dom
Horizontal line between report content
Description
Use an object of the mlreportgen.dom.HorizontalRule class to insert a horizontal line to visually separate report content
in a report.
To see what DOM objects you can append an mlreportgen.dom.HorizontalRule
object to, see Append mlreportgen.dom.HorizontalRule object to DOM class object
.
The mlreportgen.dom.HorizontalRule class is a handle class.
Creation
Description
creates an unspecified horizontal line.horizontalRuleObj = HorizontalRule
Properties
Line style for horizontal rule, specified as one of these values.
| Border Style | Description | Supported in Microsoft® Word | Supported in HTML and PDF |
|---|---|---|---|
"dashed" | Dashed line | yes | yes |
"dashdotstroked" | Line with alternating diagonal dashes and dot | yes | yes |
"dashsmallgap" | Dashed line with a small gap between dashes | yes | yes |
"dotted" | Dotted line | yes | yes |
"dotdash" | Line with alternating dots and dashes | yes | no |
"dotdotdash" | Line with alternating double dots and a dash | yes | no |
"double" | Double line | yes | yes |
"doublewave" | Double wavy line | yes | no |
"groove" | 3-D effect grooved line | no | yes |
"hidden" | No line When there is a conflicting border style, the
| no | yes |
"inset" | 3-D effect line | no | yes |
"none" | No line When there is a conflicting border style, the
conflicting border style takes precedence over | yes | yes |
"outset" | 3-D effect line | yes | yes |
"ridge" | 3-D effect ridged line | no | yes |
"single" | Single line | yes | yes |
"solid" | Single line | no | yes |
"thick" | Thick line | yes | no |
"thickthinlargegap" | Dashed line with alternating thick and thin dashes with a large gap | yes | no |
"thickthinmediumgap" | Dashed line with alternating thick and thin dashes with a medium gap | yes | no |
"thickthinsmallgap" | Dashed line with alternating thick and thin dashes with a small gap | yes | no |
"thinthicklargegap" | Dashed line with alternating thin and thick dashes with a large gap | yes | no |
"thinthickmediumgap" | Dashed line with alternating thin and thick dashes with a medium gap | yes | no |
"thinthicksmallgap" | Dashed line with alternating thin and thick dashes with a small gap | yes | no |
"thinthickthinlargegap" | Dashed line with alternating thin and thick dashes with a large gap | yes | no |
"thinthickthinmediumgap" | Dashed line with alternating thin and thick dashes with a medium gap | yes | no |
"thinthickthinsmallgap" | Dashed line with alternating thin and thick dashes with a small gap | yes | no |
"threedemboss" | Embossed effect line | yes | no |
"threedengrave" | Engraved effect line | yes | no |
"triple" | Triple line | yes | no |
"wave" | Wavy line | yes | no |
Note
For Microsoft Word reports, when you assign an mlreportgen.dom.Border object to
the Style property of an
mlreportgen.dom.TableHeaderEntry,
mlreportgen.dom.TableEntry, or
mlreportgen.dom.HorizontalRule object, the reporter does not support
"inset" or "outset" styles for this
property.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Color of the line, specified as a character vector or string scalar that contains a CSS color name, hexadecimal RGB value, or decimal RGB value.
| Format | Value |
|---|---|
| CSS color name | Specify a CSS color name. For a list of CSS color names, see https://www.w3.org/wiki/CSS/Properties/color/keywords. |
| Hexadecimal RGB value | Use the format "#RRGGBB". Use # as the first character
and two-digit hexadecimal numbers for the red, green, and blue values. You can
use uppercase or lowercase letters. |
| Decimal RGB color value | Use the format "rgb(r,g,b)", where r,
g, and b are comma-separated positive
integers that specify the red, green, and blue values, respectively. Each value
range must be between 0 and 255. |
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Width of line, specified as a 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"— Pixels"cm"— Centimeters"in"— Inches"mm"— Millimeters"pc"— Picas"pt"— Points
You can also specify pixels by omitting the unit. For example, "5"
specifies 5 pixels.
Example: "5pt"
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Background color of the line specified as a character vector or string scalar that contains a CSS color name, hexadecimal RGB value, or decimal RGB value.
| Format | Value |
|---|---|
| CSS color name | Specify a CSS color name. For a list of CSS color names, see https://www.w3.org/wiki/CSS/Properties/color/keywords. |
| Hexadecimal RGB value | Use the format "#RRGGBB". Use # as the first character
and two-digit hexadecimal numbers for the red, green, and blue values. You can
use uppercase or lowercase letters. |
| Decimal RGB color value | Use the format "rgb(r,g,b)", where r,
g, and b are comma-separated positive
integers that specify the red, green, and blue values, respectively. Each value
range must be between 0 and 255. |
Note
This property applies only to HTML reports.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Name of stylesheet-defined style, specified as a character vector or string scalar.
The style name is the name of a style specified in the style sheet of the document or
document part to which this element is appended. The specified style defines the
appearance of this element in the output document unless the formats specified by the
Style property of this element override it. To learn more about
using style sheets, see Use Style Sheet Styles.
Note
Microsoft Word reports ignore style names that are not defined in the document template. For more information on Microsoft Word templates, see Templates for DOM API Report Programs.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Format specification for this document element object, specified as a cell array of
DOM format objects. The formats specified by this property override corresponding
formats specified by the StyleName property of this element.
Formats that do not apply to this document element object are ignored.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: cell
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
Methods
Method | Purpose |
|---|---|
clone |
Note Do not append the same object to a document more than once. Use clone to create a copy when you want to reuse the same content elsewhere in a document. Input Arguments
Return Values
For more information, see the equivalent method for the
|
Examples
import mlreportgen.dom.*; doctype = "html"; d = Document("horizontalRule",doctype); p1 = Paragraph("Top content"); append(d,p1); hr = HorizontalRule(); hr.Border = "dotted"; hr.BorderColor = "blue"; append(d,hr); p2 = Paragraph("Bottom content"); append(d,p2); close(d); rptview(d.OutputPath);
More About
You can append an mlreportgen.dom.HorizontalRule object to
these DOM class objects:
mlreportgen.dom.HTMLPage(since R2024a)mlreportgen.dom.TemplateDocumentPart(since R2023b)
Version History
Introduced in R2015bStarting in R2021a, you cannot specify the background color of a horizontal rule in a PDF report.
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)