<mrow>

  • Revision slug: MathML/Element/mrow
  • Revision title: mrow
  • Revision id: 34431
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment remove labels, use new compat table; 157 words added, 70 words removed

Revision Content

Summary

The MathML <mrow> element is used to group sub-expressions, which usually contain one or more operators with their respective operands (such as {{ MathMLElement("mi") }} and {{ MathMLElement("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) or rtl (right to left).
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.

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>

Browser compatibility

{{ CompatibilityTable() }}

{{ CompatTableDesktop( ['Basic support', CompatNo(), CompatGeckoDesktop("1.0"), CompatNo(), "9.5", "5.1"], ['dir', CompatNo(), CompatGeckoDesktop("12.0"), CompatNo(), CompatNo(), CompatNo()], ['href', CompatNo(), CompatGeckoDesktop("7.0"), CompatNo(), CompatNo(), CompatNo()], ['mathbackground', CompatNo(), CompatGeckoDesktop("2.0"), CompatNo(), CompatNo(), "5.1"], ['mathcolor', CompatNo(), CompatGeckoDesktop("2.0"), CompatNo(), CompatNo(), "5.1"] ) }}

{{ CompatTableMobile( ['Basic support', CompatNo(), CompatNo(), CompatGeckoMobile("1.0"), CompatNo(), CompatNo(), CompatNo()], ['dir', CompatNo(), CompatNo(), CompatGeckoMobile("12.0"), CompatNo(), CompatNo(), CompatNo()], ['href', CompatNo(), CompatNo(), CompatGeckoMobile("7.0"), CompatNo(), CompatNo(), CompatNo()], ['mathbackground', CompatNo(), CompatNo(), CompatGeckoMobile("2.0"), CompatNo(), CompatNo(), CompatNo()], ['mathcolor', CompatNo(), CompatNo(), CompatGeckoMobile("2.0"), CompatNo(), CompatNo(), CompatNo()] ) }}

Specification

  • {{ spec("http://www.w3.org/TR/MathML/chapter3.html#presm.mrow","MathML 3.0 Presentation Markup mrow", "REC") }}

See also

  • Grouping HTML elements: {{ HTMLElement("div") }}

Revision Source

<h2 id="Summary">Summary</h2>
<p>The MathML <code>&lt;mrow&gt;</code> element is used to group sub-expressions, which usually contain one or more <a href="/en/MathML/Element/mo" title="en/MathML/Element/mo">operators</a> with their respective operands (such as {{ MathMLElement("mi") }} and {{ MathMLElement("mn") }}). This element renders as a horizontal row containing its arguments.</p>
<p>When writing a MathML expression, you should group elements within an <code>&lt;mrow&gt;</code> 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:</p>
<ul> <li>It can improve the display by possibly affecting spacing.</li> <li>It allows for more intelligent line-breaking and indentation.</li> <li>It simplifies the interpretation of the expression by automated systems such as computer algebra systems and audio renderers.</li>
</ul>
<h2 id="Attributes">Attributes</h2>
<dl> <dt id="attr-class-id-style">class, id, style</dt> <dd>Provided for use with <a href="/en/CSS" title="en/CSS/">stylesheets</a>.</dd> <dt id="attr-dir">dir</dt> <dd>Overall directionality of formulas. Possible values are either <code>ltr</code> (left to right) or <code>rtl</code> (right to left).</dd> <dt id="attr-href">href</dt> <dd>Used to set a hyperlink to a specified URI.</dd> <dt id="attr-mathbackground">mathbackground</dt> <dd>The background color. You can use <code>#rgb</code>, <code>#rrggbb</code> and <a href="/en/CSS/color_value#HTML.2fSVG.2fX11.c2.a0_Color_Keywords" title="en/CSS/color value#HTML.2fSVG.2fX11.c2.a0 Color Keywords">HTML color names</a>.</dd> <dt id="attr-mathcolor">mathcolor</dt> <dd>The text color. You can use <code>#rgb</code>, <code>#rrggbb</code> and <a href="/en/CSS/color_value#HTML.2fSVG.2fX11.c2.a0_Color_Keywords" title="en/CSS/color value#HTML.2fSVG.2fX11.c2.a0 Color Keywords">HTML color names</a>.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre class="brush: html">&lt;math&gt; 

  &lt;mrow&gt;
    &lt;mn&gt; 1 &lt;/mn&gt;
    &lt;mo&gt; + &lt;/mo&gt;
    &lt;mn&gt; 1 &lt;/mn&gt;
  &lt;/mrow&gt;
 
  &lt;mrow&gt;
    &lt;mo&gt; ( &lt;/mo&gt;
    &lt;mrow&gt;
      &lt;mi&gt; x &lt;/mi&gt;
      &lt;mo&gt; , &lt;/mo&gt;
      &lt;mi&gt; y &lt;/mi&gt;
    &lt;/mrow&gt;
    &lt;mo&gt; ) &lt;/mo&gt;
  &lt;/mrow&gt;

&lt;/math&gt;
</pre>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<p>{{ CompatTableDesktop( ['Basic support', CompatNo(), CompatGeckoDesktop("1.0"), CompatNo(), "9.5", "5.1"], ['dir', CompatNo(), CompatGeckoDesktop("12.0"), CompatNo(), CompatNo(), CompatNo()], ['href', CompatNo(), CompatGeckoDesktop("7.0"), CompatNo(), CompatNo(), CompatNo()], ['mathbackground', CompatNo(), CompatGeckoDesktop("2.0"), CompatNo(), CompatNo(), "5.1"], ['mathcolor', CompatNo(), CompatGeckoDesktop("2.0"), CompatNo(), CompatNo(), "5.1"] ) }}</p>
<p>{{ CompatTableMobile( ['Basic support', CompatNo(), CompatNo(), CompatGeckoMobile("1.0"), CompatNo(), CompatNo(), CompatNo()], ['dir', CompatNo(), CompatNo(), CompatGeckoMobile("12.0"), CompatNo(), CompatNo(), CompatNo()], ['href', CompatNo(), CompatNo(), CompatGeckoMobile("7.0"), CompatNo(), CompatNo(), CompatNo()], ['mathbackground', CompatNo(), CompatNo(), CompatGeckoMobile("2.0"), CompatNo(), CompatNo(), CompatNo()], ['mathcolor', CompatNo(), CompatNo(), CompatGeckoMobile("2.0"), CompatNo(), CompatNo(), CompatNo()] ) }}</p>
<h2 id="Specification">Specification</h2>
<ul> <li>{{ spec("http://www.w3.org/TR/MathML/chapter3.html#presm.mrow","MathML 3.0 Presentation Markup mrow", "REC") }}</li>
</ul>
<h2 id="See_also">See also</h2>
<ul> <li>Grouping HTML elements: {{ HTMLElement("div") }}</li>
</ul>
Revert to this revision