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.


class, id, style

Provided for use with stylesheets.


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. See also movablelimits on <mo>.


Overall directionality of formulas. Possible values are either ltr (left to right) or rtl (right to left).


Used to set a hyperlink to a specified URI.


The background color. You can use #rgb, #rrggbb and HTML color names.


The text color. You can use #rgb, #rrggbb and HTML color names.



    <mn> 1 </mn>
    <mo> + </mo>
    <mn> 1 </mn>

    <mo> ( </mo>
      <mi> x </mi>
      <mo> , </mo>
      <mi> y </mi>
    <mo> ) </mo>



MathML Core
# horizontally-group-sub-expressions-mrow

Browser compatibility

BCD tables only load in the browser

See also

  • Grouping HTML elements: <div>