Main Content

mlreportgen.dom.HorizontalRule class

Package: mlreportgen.dom

Horizontal line between report content


Horizontal line to visually separate report content in a report. You can append a HorizontalRule object to these objects:

  • mlreportgen.dom.Document

  • mlreportgen.dom.DocumentPart

  • mlreportgen.dom.TableEntry

  • mlreportgen.dom.Group

  • mlreportgen.dom.Container

The mlreportgen.dom.HorizontalRule class is a handle class.




horizontalRuleObj = HorizontalRule() creates an unspecified horizontal line.


expand all

Line style for horizontal rule, specified as one of these values.

ValueApplies To

Color of the line, specified as a character vector. You can specify:

Width of line (in an HTML report), specified in the format valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Background color of the line, specified as a character vector. You can specify:

This property applies only to HTML reports.

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.

Format specification for the line, specified as an array of format objects.

Style sheet style for line, specified as a character vector. The name of a style must be 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 where not overridden by the formats specified by the Style property of this element.

Tag for line, specified as a character vector.

A session-unique ID is generated as part of document element creation. The generated tag has the form CLASS:ID, where CLASS is the class of the element and ID is the value of the Id property of the object. You can specify a tag to replace the generated tag.

To make it easier to identify where an issue occurred during document generation, you can Specify your own tag value.


expand all


collapse all

import mlreportgen.dom.*;
doctype = 'html';
d = Document('horizontalRule',doctype);
p1 = Paragraph('Top content');

hr = HorizontalRule();
hr.Border = 'dotted';
hr.BorderColor = 'blue';

p2 = Paragraph('Bottom content');


Version History

Introduced in R2015b

expand all