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.HTMLFile
Package: mlreportgen.dom

Append HTML to HTMLFile object

Syntax

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

Description

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

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

Input Arguments

expand all

HTMLFile object to append content to, specified as an mlreportgen.dom.HTMLFile 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.

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

Output Arguments

expand all

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

Examples

expand all

This example assumes that there is an HTML file called myHTMLfile.html in the MATLAB® current folder.

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

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

Append content to the HTMLFile object and append the HTMLFile object to the document.

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

Generate the report.

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

Introduced in R2015a

Was this topic helpful?