mlreportgen.dom.OuterMargin class

Package: mlreportgen.dom
Superclasses:

Margin between bounding box and its surroundings

Description

Specifies the margin between the bounding box of an object and adjacent document objects. A bounding box of an object includes the border of the object (if it has a border), the inner margin, and the object content.

Construction

marginObj = OuterMargin() creates an unspecified margin between the bounding box of an object and its surroundings.

marginObj = OuterMargin(all) creates the specified margin on all sides between the bounding box of an object and its surroundings.

marginObj = OuterMargin(left,right) creates the specified margins between the left and right sides of the bounding box of an object and its surroundings.

marginObj = OuterMargin(left,right,top,bottom) creates the specified margins between sides of the bounding box of an object and its surroundings.

Input Arguments

expand all

Margin on all sides between the bounding box of an object and its surroundings in the form 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

Left margin between the bounding box of an object and its surroundings. See the all argument for description of valid values.

Right margin between the bounding box of an object and its surroundings. See the all argument for description of valid values.

Top margin between the bounding box of an object and its surroundings. See the all argument for description of valid values. Word reports ignore the Top margin setting of a table.

Bottom margin between the bounding box of an object and its surroundings. See the all argument for description of valid values. Word reports ignore the Bottom margin setting of a table.

Output Arguments

expand all

A mlreportgen.dom.OuterMargin object specifying the margin between bounding box and surroundings.

Properties

expand all

Bottom margin in the form 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

Note

Tables in Word reports ignore the Bottom property. To control the spacing between a table and the succeeding content, insert an invisible table or paragraph below the table. For example, to create two successive tables 1 inch apart, insert an invisible 1-inch high table. Alternatively, insert an empty paragraph with a setting for line height setting of 0 and a setting for spacing before of 1 inch.

Left margin size. See the Bottom property for description of valid values.

Right margin size. See the Bottom property for description of valid values.

Top margin size. See the Bottom property for description of valid values.

Note

Tables in Word reports ignore the Top property. To control the spacing between a table and the preceding content, insert an invisible table or paragraph above the table. For example, to create two successive tables 1 inch apart, insert an invisible 1-inch high table. Alternatively, insert an empty paragraph with a setting for line height setting of 0 and a setting for spacing before of 1 inch.

ID for this document element, specified as a character vector. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Tag for the document element, specified as a character vector.

The DOM generates a session-unique tag when it creates the document element. Structure the tag as class:id, where class is the class of the element and id is the value of the Id property. You can specify a tag to replace the generated tag. Specifying your own tag can make it easier to identify where an issue occurred during document generation.

Examples

collapse all

import mlreportgen.dom.*;
doctype = 'html';
d = Document('test',doctype);

p = Paragraph('Hello World');
p.Style = {Border('solid','Red'), ...
   HAlign('center'),...
   OuterMargin('0pt','0pt','0pt','24pt')};
append(d,p);

p = Paragraph('Greetings from MATLAB');
p.Style = {Border('solid','green'), ...
   HAlign('center')};
append(d,p);

p = Paragraph('End of report');
p.Style = {Border('solid','blue'),...
   HAlign('center'),...
   OuterMargin('0pt','0pt','0pt','12pt')};
append(d,p);

close(d);
rptview('test',doctype);