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.

mlreportgen.ppt.TableRow.append

Package: mlreportgen.ppt

Append table entry to table row

Syntax

tableEntryObj = append(tableRow,entry)

Description

example

tableEntryObj = append(tableRow,entry) appends a table entry to a table row.

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myTableEntryPresentation.pptx';
slides = Presentation(slidesFile);
add(slides,'Title and Content');

Create a table with three columns.

table1 = Table(3);

Create the first table row.

tr1 = TableRow();
tr1.Style = {Bold(true)};

Create three table entries for the first row.

te1tr1 = TableEntry();
p = Paragraph('first entry');
p.FontColor = 'red';
append(te1tr1,p);

te2tr1 = TableEntry();
append(te2tr1,'second entry');

te3tr1 = TableEntry();
te3tr1.Style = {FontColor('green')};
append(te3tr1,'third entry');

Append the table entries to the first row.

append(tr1,te1tr1);
append(tr1,te2tr1);
append(tr1,te3tr1);

Create the second table row.

tr2 = TableRow();

Create three table entries for the second row.

te1tr2 = TableEntry();
te1tr2.Style = {FontColor('red')};
p = Paragraph('first entry');
append(te1tr2,p);

te2tr2 = TableEntry();
append(te2tr2,'second entry');

te3tr2 = TableEntry();
te3tr2.Style = {FontColor('green')};
append(te3tr2,'third entry');

Append the table entries to the second row.

append(tr2,te1tr2);
append(tr2,te2tr2);
append(tr2,te3tr2);

Append the table rows to the table.

append(table1,tr1);
append(table1,tr2);

Use the mlreportgen.ppt.Presentation.find method to find the slides that have a Content placeholder. In this case, there are two.

contents = find(slides,'Content');

Replace the table in the second slide with table1.

replace(contents(1),table1);

Generate the presentation. Open myTableEntryPresentation.pptx. On a Windows® platform, you can open the presentation in MATLAB®:

close(slides);

if ispc
    winopen(slidesFile);
end

Input Arguments

collapse all

Table row to append content to, specified as an mlreportgen.ppt.TableRow object.

Table entry to append to a table row, specified as an mlreportgen.ppt.TableEntry object.

Output Arguments

collapse all

Table entry, returned as an mlreportgen.dom.TableEntry object.

Introduced in R2015b

Was this topic helpful?