HTML5 MathML
HTML5 MathML provides a way to write mathematics on web page. All mathematical expression are written inside <math> tag. There are many child elements of math element. Unfortunately, not all browsers support math element. So use the latest mozilla or chrome for render it.
Child elements of Math attribute
Element | Description | Example |
mi | Identifier | <mi>a</mi> |
mn | Numeric literal | <mn>2</mn> |
mo | Operator, Fence, Separator | <mo>+</mo> |
mtext | text | <mtext>Theorem</mtext> |
mspace | blank space | <mspace> </mspace> |
ms | String Literal | <ms>&</ms> |
mglyph | Accessing glyphs for characters | <mglyph src="/my-glyph.png" alt="my glyph"></mglyph> |
mrow | Horizontally Group Sub-Expressions | <mrow><mi>x</mi></mrow> |
mfrac | Fractions | <mfrac> numerator denominator </mfrac> |
msqrt | Radicals | <msqrt> base </msqrt> |
merror | Error Message | <merror><mtext>Unauthertized</mtext></merror> |
mfenced | Expression Inside Pair of Fences | <mfenced><mi>x</mi></mfenced> |
msup | Superscript | <msup>x</msup> |
msub | Subscript | <msub>x</msub> |
mover | Overscript | <mover><mi>x</mi> <mo> ^</mo> </mover> |
mtable | Table or Matrix | <mtable><mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> <mtd> <mn>1</mn> </mtd> <mtr></mtable> |
msline | Horizontal Line | <msline/> |
Matrix Example
<math>
<mtable>
<mtr>
<mtd> <mn>1</mn> </mtd>
<mtd> <mn>0</mn> </mtd>
<mtd> <mn>1</mn> </mtd>
</mtr>
<mtr>
<mtd> <mn>1</mn> </mtd>
<mtd> <mn>1</mn> </mtd>
<mtd> <mn>1</mn> </mtd>
</mtr>
<mtr>
<mtd> <mn>0</mn> </mtd>
<mtd> <mn>0</mn> </mtd>
<mtd> <mn>1</mn> </mtd>
</mtr>
</mtable>
</math>
The output of the above code
1 0 1 1 1 1 0 0 1