The MathML <mtable> element allows you to create tables or matrices. Inside a <mtable> only <mtr> and <mtd> elements may appear. These elements are similar to <table> , <tr> and <td> elements of HTML.

Note: The <mtable> element resets the displaystyle attribute to false. If you want to use this element as an inline-block, you might want to set <mtable displaystyle="true">...</mtable>.

Attributes

align
Specifies the vertical alignment of the table with respect to its environment.
Possible values are:
  • axis (default): The vertical center of the table aligns on the environment's axis (typically the minus sign).
  • baseline: The vertical center of the table aligns on the environment's baseline.
  • bottom: The bottom of the table aligns on the environments baseline.
  • center: See baseline.
  • top: The top of the table aligns on the environments baseline.
In addition, values of the align attribute can end with a rownumber (e.g. align="center 3"). This allows you to align the specified row of the table rather than the whole table. A negative Integer value counts rows from the bottom of the table. Starting with Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5) the interpretation of negative values has been corrected (bug 601436). In Gecko 17.0 (Firefox 17.0 / Thunderbird 17.0 / SeaMonkey 2.14) the parsing has been updated to treat whitespace correctly.
alignmentscope
Unimplemented
class, id, style
Provided for use with stylesheets.
columnalign
Specifies the horizontal alignment of the cells. Multiple values separated by space are allowed and apply to the corresponding columns (e.g. columnalign="left right center"). Possible values are: left, center (default) and right.
columnlines
Specifies column borders. Multiple values separated by space are allowed and apply to the corresponding columns (e.g. columnlines="none none solid"). Possible values are: none (default), solid and dashed.
columnspacing
Specifies the space between table columns.
Unimplemented columnwidth
Specifies the width of table columns.
displaystyle
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true.
Unimplemented equalcolumns
A Boolean value indicating whether to force all columns to have the same total height. false is default.
Unimplemented equalrows
A Boolean value indicating whether to force all rows to have the same total height. false is default.
frame
Specifies borders of the entire table. Possible values are: none (default), solid and dashed.
framespacing
Specifies additional space added between the table and frame.
groupalign
Unimplemented
href
Used to set a hyperlink to a specified URI.
mathbackground
The background color. You can use #rgb, #rrggbb and HTML color names.
mathcolor
The text color. You can use #rgb, #rrggbb and HTML color names.
Unimplemented minlabelspacing
A length value specifing the minimum space between a label and the adjacent cell in the row.
rowalign
Specifies the vertical alignment of the cells. Multiple values separated by space are allowed and apply to the corresponding rows (e.g. rowalign="top bottom axis"). Possible values are: axis, baseline (default), bottom, center and top.
rowlines
Specifies row borders. Multiple values separated by space are allowed and apply to the corresponding rows (e.g. rowlines="none none solid"). Possible values are: none (default), solid and dashed.
Unimplemented rowspacing
Specifies the space between table rows.
Unimplemented side
Specifies the position where <mlabeledtr> label elements should be placed. Possible values are: left, right (default), leftoverlap and rightoverlap.
width
Specifies the width of the entire table. Accepts length values.

Examples

Alignment with row number

Rendering:

<math>
    
    <mi>X</mi>
    <mo>=</mo>
    <mtable frame="solid" rowlines="solid" align="axis 3">
        <mtr>
             <mtd><mi>A</mi></mtd>
             <mtd><mi>B</mi></mtd>
        </mtr>
        <mtr>
             <mtd><mi>C</mi></mtd>
             <mtd><mi>D</mi></mtd>
        </mtr>
        <mtr>
             <mtd><mi>E</mi></mtd>
             <mtd><mi>F</mi></mtd>
        </mtr>
    </mtable>

</math>

Specifications

Specification Status Comment
MathML 3.0
The definition of 'mtable' in that specification.
Recommendation Current specification
MathML 2.0
The definition of 'mtable' in that specification.
Recommendation Initial specification

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari Full support 5.1WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
alignChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
alignmentscopeChrome No support NoEdge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?
columnalignChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari Full support 5.1WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
columnlinesChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari Full support 5.1WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
columnspacingChrome No support NoEdge ? Firefox Full support 33IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 33Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
columnwidthChrome No support NoEdge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?
displaystyleChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
equalcolumnsChrome No support NoEdge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?
equalrowsChrome No support NoEdge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?
frameChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari Full support 5.1WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
framespacingChrome No support NoEdge ? Firefox Full support 33IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 33Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
groupalignChrome No support NoEdge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?
hrefChrome No support NoEdge ? Firefox Full support 7IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 7Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
mathbackgroundChrome No support NoEdge ? Firefox Full support 4IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
mathcolorChrome No support NoEdge ? Firefox Full support 4IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
minlabelspacingChrome No support NoEdge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?
rowalignChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari Full support 5.1WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
rowlinesChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari Full support 5.1WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
rowspacingChrome No support NoEdge ? Firefox Full support 33IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 33Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
sideChrome No support NoEdge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?
widthChrome No support NoEdge ? Firefox Full support 13IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 14Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

Contributors to this page: ExE-Boss, Draussenduscher, fscholz, teoli, Sheppy
Last updated by: ExE-Boss,