Matrix.HTML
-----------

Queries html of matrix.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Matrix](component_Matrix.md) | [13.3](newinversion133.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Matrix.HTML"; MatrixRef { ; FirstRow; LastRow; firstCol; lastCol; Flags; CSS Style } ) 

**MBS**( **"Matrix.HTML";** /\* Queries html of matrix. \*/  
**$MatrixRef**; /\* The matrix reference number.e.g. $matrix \*/   
**$FirstRow**; /\* Optional; The index of first row.  
Default is 0.e.g. 0 \*/   
**$LastRow**; /\* Optional; The index of last row.  
Default is [Matrix.Height](MatrixHeight.md)-1.e.g. 5 \*/   
**$firstCol**; /\* Optional; The index of first column.  
Default is 0.e.g. 0 \*/   
**$lastCol**; /\* Optional; The index of last column.  
Default is [Matrix.Width](MatrixWidth.md)-1.e.g. 6 \*/   
**$Flags**; /\* Optional; The flags for processing.  
Currently you can pass 1 to exclude html header and just get a HTML table.e.g. 0 \*/   
**$CSS Style**) /\* Optional; Extra CSS / HTML to include. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| MatrixRef | The matrix reference number. | $matrix |  |
| FirstRow | The index of first row.   Default is 0. | 0 | Optional |
| LastRow | The index of last row.   Default is [Matrix.Height](MatrixHeight.md)-1. | 5 | Optional |
| firstCol | The index of first column.   Default is 0. | 0 | Optional |
| lastCol | The index of last column.   Default is [Matrix.Width](MatrixWidth.md)-1. | 6 | Optional |
| Flags | The flags for processing.   Currently you can pass 1 to exclude html header and just get a HTML table. | 0 | Optional      Added in version **13.5**. |
| CSS Style | Extra CSS / HTML to include. |  | Optional      Added in version **14.0**. |

### Result

Returns text or error.

### Description

Queries html of matrix.  
You can use this method to quickly get all values in a given area as html text to show in a web viewer.  
This joins the values and removes text formatting.  
Numbers, times and dates are right aligned.  
  
If the matrix has column names, we add them as headers over the html columns.  
### Examples

Show html in web viewer made from data in Excel:

 # load data from Excel document   
Set Variable \[ $matrix ; Value: MBS ( "[XL.Sheet.ReadCellsAsMatrix](XLSheetReadCellsAsMatrix.md)";   
$bookRef ;   
0; // sheet index  
0; // first row  
9; // last row  
0; // first column  
5) // last column \]   
\# now make html   
Set Variable \[ $html ; Value: MBS ( "Matrix.HTML"; $matrix ) \]   
\# and show in web viewer   
Set Web Viewer \[ Object Name: "web" ; URL: "data:text/html;charset=utf-8," &amp; $html \]  
### See also

- [Matrix.Height](MatrixHeight.md)
- [Matrix.Width](MatrixWidth.md)
- [XL.Sheet.ReadCellsAsMatrix](XLSheetReadCellsAsMatrix.md)

### Release notes

- **Version 14.2**
    - Improved [Matrix.HTML](https://www.mbsplugins.eu/MatrixHTML.shtml) and [JSON.ToHTML](https://www.mbsplugins.eu/JSONToHTML.shtml) to use CSS for right alignment.
- **Version 14.0**
    - Added CSS parameter for [Matrix.HTML](https://www.mbsplugins.eu/MatrixHTML.shtml) function.
- **Version 13.5**
    - Added Flags Parameter for [Matrix.HTML](https://www.mbsplugins.eu/MatrixHTML.shtml) function.
- **Version 13.3**
    - Added [Matrix.HTML](https://www.mbsplugins.eu/MatrixHTML.shtml) function.

### Blog Entries

- [MBS FileMaker Advent calendar - Door 4 - FM.SQL.Executeand life in the matrix](https://www.mbsplugins.de/archive/2025-12-04/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.2pr1](https://www.mbsplugins.de/archive/2024-04-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 14.0](https://www.mbsplugins.de/archive/2024-01-23/New_in_MBS_FileMaker_Plugin_14/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.6pr3](https://www.mbsplugins.de/archive/2023-12-13/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.5pr1](https://www.mbsplugins.de/archive/2023-09-26/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 13.3](https://www.mbsplugins.de/archive/2023-07-25/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [Neues MBS Plugin 13.3 für Claris FileMaker](https://www.mbsplugins.de/archive/2023-07-18/Neues_MBS_Plugin_133_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 13.3 for Claris FileMaker](https://www.mbsplugins.de/archive/2023-07-18/MBS_Plugin_133_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.3pr1](https://www.mbsplugins.de/archive/2023-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 12nd May 2023 , last changed 11st December 2023

  
[Matrix.GetValue](MatrixGetValue.md) - [Matrix.Height](MatrixHeight.md)

[HTML Version](MatrixHTML.shtml)