The MathML <mrow> element is used to group sub-expressions, which usually contain one or more operators with their respective operands (such as <mi> and <mn>). This element renders as a horizontal row containing its arguments.
When writing a MathML expression, you should group elements within an <mrow> in the same way as they are grouped in the mathematical interpretation of the expression. Proper grouping helps the rendering of the expression in several ways:
- It can improve the display by possibly affecting spacing.
- It allows for more intelligent line-breaking and indentation.
- It simplifies the interpretation of the expression by automated systems such as computer algebra systems and audio renderers.
Attributes
- class, id, style
- Provided for use with stylesheets.
- dir
- Overall directionality of formulas. Possible values are either
ltr(left to right) orrtl(right to left). - href
- Used to set a hyperlink to a specified URI.
- mathbackground
- The background color. You can use
#rgb,#rrggbband HTML color names. - mathcolor
- The text color. You can use
#rgb,#rrggbband HTML color names.
Examples
<math>
<mrow>
<mn> 1 </mn>
<mo> + </mo>
<mn> 1 </mn>
</mrow>
<mrow>
<mo> ( </mo>
<mrow>
<mi> x </mi>
<mo> , </mo>
<mi> y </mi>
</mrow>
<mo> ) </mo>
</mrow>
</math>
Specifications
| Specification | Status | Comment |
|---|---|---|
| MathML 3.0 The definition of 'mrow' in that specification. |
Recommendation | Current specification |
| MathML 2.0 The definition of 'mrow' in that specification. |
Recommendation | Initial specification |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
mrow | Chrome No support No | Edge No support No | Firefox Full support 1 | IE No support No | Opera No support No | Safari Full support 6 | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 4 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
dir | Chrome No support No | Edge No support No | Firefox Full support 12 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 14 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
href | Chrome No support No | Edge No support No | Firefox Full support 7 | IE No support No | Opera No support No | Safari Full support 10 | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 7 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
mathbackground | Chrome No support No | Edge No support No | Firefox Full support 4 | IE No support No | Opera No support No | Safari Full support 6 | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 4 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
mathcolor | Chrome No support No | Edge No support No | Firefox Full support 4 | IE No support No | Opera No support No | Safari Full support 6 | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 4 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
Legend
- Full support
- Full support
- No support
- No support
See also
- Grouping HTML elements:
<div>
