Main Content

mlreportgen.dom.CSSProperties Class

Namespace: mlreportgen.dom

Array of CSS properties for formatting HTML output

Description

Creates an object that contains one or more cascading style sheet (CSS) formats for HTML output. Specify the formats using mlreportgen.dom.CSSProperty. For information on CSS properties, see W3Schools CSS Reference.

Note

Use CSSProperty objects only for formats not supported by DOM format objects. Most DOM format objects work for any output type. Using CSSProperty objects makes your report application specific to HTML output.

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

Creation

Description

props = CSSProperties(prop) creates a CSSProperties object based on mlreportgen.dom.CSSProperty objects. The mlreportgen.dom.CSSProperty object specifies the CSS format and value.

example

Input Arguments

expand all

CSS property format, specified as an mlreportgen.dom.CSSProperty object or as an array or cell array of mlreportgen.dom.CSSProperty objects.

Properties

expand all

CSS properties, specified as an array of mlreportgen.dom.CSSProperty objects.

Parent of mlreportgen.dom.CSSProperties object, specified as a document element object. A document element must have only one parent.

Attributes:

SetAccess
private
NonCopyable
true

Tag for the mlreportgen.dom.CSSProperties 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

Object identifier for the mlreportgen.dom.CSSProperties 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

Examples

collapse all

This example uses a CSSProperties object to apply an HTML-specific list format, list-style-position, for which there is no DOM equivalent.

import mlreportgen.dom.*

d = Document('list-style-pos','html');

p = Paragraph('This list has list-style-position set to inside:');
append(d,p);
list = UnorderedList({'Earl Grey','Jasmine','Honeybush'});
list.Style = {CSSProperties(CSSProperty('list-style-position','inside'))};
append(d,list);

p = Paragraph('This list has list-style-position set to outside:');
append(d,p);
list = clone(list);
listprop = CSSProperty('list-style-position','outside');
list.Style = {CSSProperties(listprop)};
append(d,list);

close(d);
rptview(d.OutputPath);

Version History

Introduced in R2016a