Main Content

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

Version History

Introduced in R2015a