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.

append

Class: mlreportgen.dom.HTML
Package: mlreportgen.dom

Append HTML string to HTML object

Syntax

htmlObjOut = append(htmlObj,htmlText)
htmlObjOut = append(htmlObj,htmlObjToAppend)

Description

htmlObjOut = append(htmlObj,htmlText) converts HTML string into an HTML object and appends the object to htmlObj.

htmlObjOut = append(htmlObj,htmlObjToAppend) appends the htmlObjToAppend object to htmlObj.

Input Arguments

expand all

HTML object to append content to, specified as an mlreportgen.dom.HTML object.

HTML text, specified as a character vector

Example: '<p><b>Hello</b> <i style="color:green">World</i></p>'

HTML object to append, specified as an mlreportgen.dom.HTML object.

Output Arguments

expand all

HTML content appended to an HTML object, returned as an mlreportgen.dom.HTML object.

Examples

expand all

Create an HTML object from HTML text, to use for a Microsoft® Word report.

import mlreportgen.dom.*;
rpt = Document('HTML2WordReport','docx');     
htmlObj = HTML('<p><b>Hello</b> <i style="color:green">World</i></p>');

Append content to the HTML object. Append the HTML object to the document.

append(htmlObj,'<p>This is <u>me</u> speaking</p>');
append(rpt,htmlObj);

Generate the report.

close(rpt);
rptview(rpt.OutputPath);

Introduced in R2015a

Was this topic helpful?