This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

mlreportgen.dom.CSSProperties class

Package: mlreportgen.dom

Array of CSS properties for formatting HTML output


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


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.


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

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.

Output Arguments

expand all

CSS properties, returned as an mlreportgen.dom.CSSProperties object.


expand all

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.

This read-only property lists the parent of this document element.

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

Tag for document element, 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.

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


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:');
list = UnorderedList({'Earl Grey','Jasmine','Honeybush'});
list.Style = {CSSProperties(CSSProperty('list-style-position','inside'))};

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


Introduced in R2016a