User`s guide
Create and Format Lists
13-53
close(d);
rptview('myListReport','html');
You can also create an unordered list from an array by including the array in an
UnorderedList object constructor.
import mlreportgen.dom.*;
d = Document('unorderedListReport','html');
ul = UnorderedList({Text('item1'),'item 2',3});
append(d,ul);
close(d);
rptview('unorderedListReport','html');
Create an Unordered List from Scratch
You can create an unordered list from scratch by creating mlreportgen.dom.ListItem
objects and appending them to an UnorderedList object.
import mlreportgen.dom.*;
d = Document('unorderedListReport','html');
li1 = ListItem('Rank 3 magic square:');
table = append(li1,Table(magic(3)));
table.Border = 'inset';
table.Width = '1in';
li2 = ListItem('second item');
li3 = ListItem('third item');
ul = UnorderedList();
append(ul,li1);
append(ul,li2);
append(ul,li3);
append(d,ul);
close(d);
rptview('unorderedListReport','html');
Create an Ordered List
You can create an ordered list from a numeric or cell array or from scratch.