Main Content

mlreportgen.dom.OuterMargin Class

Namespace: mlreportgen.dom

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.

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

Creation

Description

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.

example

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

  • "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.

Properties

expand all

Bottom margin in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • "px" — pixels

  • "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.

Object identifier for the mlreportgen.dom.OuterMargin object, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object. You can specify your own value for Id.

Attributes:

NonCopyable
true

Data Types: char | string

Tag for the mlreportgen.dom.OuterMargin object, 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. Specify your own tag value to help you identify where to look when an issue occurs during document generation.

Attributes:

NonCopyable
true

Data Types: char | string

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);

Version History

Introduced in R2014b