Choose Type of Table to Create in Report Generator
You can use the DOM API and Report API to create four types of tables in your reports. The types of tables have different structures and are represented by different classes.
Type of Table | Class | Example | More Information |
---|---|---|---|
Formal table — A table with differently formatted header, body, and footer sections | mlreportgen.dom.FormalTable |
| Create Formal Tables |
Informal table — A table that has only a body | mlreportgen.dom.Table |
| Create Informal Tables |
MATLAB® table — A table constructed from a MATLAB table | mlreportgen.dom.MATLABTable |
| Create Tables from MATLAB Tables |
Base table — A table with a numbered title | mlreportgen.report.BaseTable |
| Create Report API Base Tables |
Choose the type of table to create based on your table requirements. In some cases, more than one type of table meets your requirements, choose the type of table based on your preferences.
Requirement | Type of Table |
---|---|
Create a table with a header or footer. |
|
Create a table without a header or footer. | Informal table |
Convert a MATLAB table to a DOM table. | MATLAB table |
Create a table with a numbered title. | Base table You can create a DOM table, then create the base table from the DOM table or you can create the base table directly from a MATLAB array. |
Divide a wide table into legible slices. | Base table If a DOM table is too wide, you can create a
base table from the DOM table and then use the |
Create an HTML table with collapsible rows. (since R2025a) |
|
See Also
Classes
mlreportgen.dom.Table
|mlreportgen.dom.FormalTable
|mlreportgen.report.BaseTable
|mlreportgen.dom.MATLABTable