User`s guide

12 Classes – Alphabetical List
12-46
mlreportgen.dom.Container class
Package: mlreportgen.dom
Container of document objects
Description
Creates a container element. Use the mlreportgen.dom.Container.append method
to append document elements to the container. Use an mlreportgen.dom.Container
object in an HTML or Microsoft Word report to apply formats to all of the children of the
container.
In HTML output, a Container object generates an HTML element of the type specified
by its HTMLTag property and containing HTML elements corresponding to its DOM
contents. For example, a Container object with the HTMLTag property div and that
contains the text Hello World generates this markup:
<div><p><span>Hello World</span></p></div>
The generated HTML container element has the class and style properties specified
by the Container object StyleName and Style properties, respectively. The rules of
HTML CSS format inheritance assure that the generated children of the Container
object inherit the formats specified by the Container object Style and StyleName
properties. For example, if the Container object specifies red as its text color and none
of its text children specify a color, the text children are colored red.
For Microsoft Word report output, a Container object simulates container format
inheritance, applying the formats specified by the Container object Style attribute
to each child, unless overridden by the child, and then appending the child to the
Word output. The Word output ignores the HTMLTag and StyleName properties of the
Container object.
Tip You can use mlreportgen.dom.Container or mlreportgen.dom.Group objects to
produce collections of document elements.
Use a container object to apply format inheritance to a set of objects and to create
HTML container elements not otherwise supported by the DOM, such as div, section,
and article.