Main Content

clone

Class: mlreportgen.dom.Container
Namespace: mlreportgen.dom

Copy container object

Syntax

clonedContainer = clone(sourceContainer)

Description

clonedContainer = clone(sourceContainer) copies (clones) the specified container.

Input Arguments

expand all

Container object to copy, specified as an mlreportgen.dom.Container object.

Output Arguments

expand all

Copied container object, returned as an mlreportgen.dom.Container object.

Examples

expand all

Create a container object. Microsoft® Word output ignores the HTML container element tag (in this example, the div tag).

import mlreportgen.dom.*;
rpt = Document('MyReport','docx');
 
c = Container();

Color all of the text in this container red.

c.Style = {Color('red')};

Append content to the container and append the container to the report.

append(c,Paragraph('Hello'));
append(c,Table(magic(5)));
append(rpt,c);

Clone the container.

clonedC = clone(c);

Append the cloned container to the report.

append(rpt,clonedC);

Close and generate the report.

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

Version History

Introduced in R2015a