Main Content

appendHeaderRow

Class: mlreportgen.dom.FormalTable
Package: mlreportgen.dom

Append row to table header

Description

example

rowObjOut = appendHeaderRow(tableObj,rowObj) appends a row of table entries to the header of this table.

Examples

expand all

Create a formal table.

import mlreportgen.dom.*;
myReport = Document('myDoc','html');

table = FormalTable({'row1 - col1' 'row1 - col2 ';...
    'row2 - col1' 'row2 - col2'});
table.Style = {Border('double'),ColSep('solid'),RowSep('solid')};
append(myReport,table);

Create a row for the header.

rowForHeader = TableRow();
col1Title = TableEntry('Column 1 header');
col2Title = TableEntry('Column 2 header');
append(rowForHeader,col1Title);
append(rowForHeader,col2Title);

Append the header row and display the report.

headerRow = appendHeaderRow(table,rowForHeader);

close(myReport);
rptview('myDoc','html');

Input Arguments

expand all

Table that contains the header to append a row to.

Row to append to the table header, specified as an mlreportgen.dom.TableRow object.

Output Arguments

expand all

Row appended to table header, represented by an mlreportgen.dom.TableRow object.

Introduced in R2014b