Before R2104b, it is not possible to center tables.
Starting in R2014b, there are multiple ways to center a table.
- Method 1 (works in R2014b or later)
- Use Micrsoft Word to customize the rgUnruledTable style to be centered in the Report Explorer's default Word template. (In R2016a or later, create a custom PDF template with a centered rgUnruledTable style.)
- Use the customized template and the PDF (from Word template), or PDF (from template) in R2016a or later, output type to generate your report.
- Method 2 (works with the DOM API in 2014b or later)
- Create a Word template (or a PDF template in R2016a or later) that defines a centered table style.
- Create a DOM document object based on the Word template (or PDF template in 16a or later).
- Create a DOM table object.
- Assign the centered table style to the object.
- Append the table to the document.
- Close the document.
- Use rptview to convert the Word document to PDF and display it. (In 16a, no conversion is necessary. Just use rptview to display the PDF document).
- Method 3 (works with the DOM API in 2014b or later)
- Create a DOM document object based on the default or a custom Word template (or default or custom PDF template in 16a or later).
- Create a DOM table object.
- Assign an HAlign('center') format to the table object.
- Append the table to the document.
- Close the document.
- Use rptview to convert the Word document to PDF and display it. (In 16a, no conversion is necessary. Just use rptview to display the PDF document).