Main Content


Class: mlreportgen.dom.HTMLFile
Package: mlreportgen.dom

Append HTML to HTMLFile object


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


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.


expand all

Create a text file named myHTMLFile.html and save it in the current folder. Add this text into the file:

<style>p {font-size:14pt;}</style>
<p style='white-space:pre'><b>Hello</b><i style='color:green'> World</i></p>

Create an mlreportgen.dom.HTMLFile object from an HTML file to use for a Microsoft® Word report.

import mlreportgen.dom.*; 
rpt = Document('MyReport','docx'); 
htmlFile = HTMLFile('myHTMLFile.html');

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

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

Generate the report.


Version History

Introduced in R2015a