Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.dom.CSSProperties class

Package: mlreportgen.dom
Superclasses:

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.com/cssref.

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.

Construction

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.

Properties

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.

Examples

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

Introduced in R2016a

Was this topic helpful?