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.

addHTML

Class: mlreportgen.dom.Document
Package: mlreportgen.dom

Append HTML string to document

Syntax

htmlObjOut = addHTML(documentObj,htmlText)

Description

htmlObjOut = addHTML(documentObj,htmlText) converts a string of HTML text to a group of DOM objects and appends the group to the Document object documentObj.

Input Arguments

expand all

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

HTML text, specified as a character vector.

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

Output Arguments

expand all

HTML object with appended content, 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('HTMLToWordReport','docx');     
htmlObj = addHTML(rpt,...
    '<p><b>Hello</b> <i style="color:green">World</i></p>');

Generate the Word report.

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

Introduced in R2015a

Was this topic helpful?