- MathML Tutorial
- MathML - Home
- MathML - Overview
- MathML - All Elements
- MathML - Basic Elements
- MathML - Carries
- MathML - Enclosing
- MathML - Fencing
- MathML - Fractions
- MathML - Long Division
- MathML - Matrices
- MathML - Multiplication
- MathML - Overscript
- MathML - Padding
- MathML - Phantom
- MathML - Radicals
- MathML - Repeating Decimals
- MathML - Style
- MathML - Subscripts
- MathML - Subscript-Superscript
- MathML - Superscripts
- MathML - Underscript
- MathML - Underscript-Overscript
- MathML Symbols
- MathML - Algebra Symbols
- MathML - Calculus Symbols
- MathML - Ellipses Symbols
- MathML - Function Symbols
- MathML - Geometry Symbols
- MathML - Greek Letters
- MathML - Invisible Operators
- MathML - Logic Symbols
- MathML - Set Symbols
- MathML Useful Resources
- MathML - Quick Guide
- MathML - Useful Resources
- MathML - Discussion
MathML - Matrices
<mtable> tag is used to draw matrices.
Syntax
mtable is similar to table tag of HTML and this tag uses mtr, mtd elements which are similar to tr and td tags of HTML.
<mtable> <mtr> <mtd></mtd></mtr></mfrac>
Attributes
Here is the description of all the attributes of this tag −
align − To specify the vertical alignment of the table . Valid values are: axis, baseline, bottom, center, top. Default is axis.
class, id, style − Used with stylesheets.
columnalign − To specify the horizontal alignment of the cells. Valid values are: left, center and right. Default is center.
columnlines − To specify column borders. Valid values are: none, solid and dashed. Default is none.
columnspacing − To specify the space between table columns.
displaystyle − If true more vertical space is used for displayed equations , if false, a more compact layout is used to display formulas.
frame − To specify borders of the entire table. Valid values are: none, solid and dashed. Default is none.
framespacing − To specify additional space added between the table and frame.
href − To specify a hyperlink to a specified uri.
mathbackground − To specify the background color. Valid formats are #rgb, #rrggbb and html color names.
mathcolor − To specify the text color. Valid formats are #rgb, #rrggbb and html color names.
rowalign − To specify vertical alignment of the cells. Valid values are axis, baseline, bottom, center and top. Default is baseline
rowlines − To specify row borders. Valid values are: none, solid and dashed. Default is none.
width − To specify width of the entire table.
Example
Let's draw a 3 x 3 metric.
<math xmlns = "http://www.w3.org/1998/Math/MathML"> <mrow> <mo>[</mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd><mn>0</mn></mtd> <mtd><mn>0</mn></mtd> </mtr> <mtr> <mtd><mn>0</mn></mtd> <mtd><mn>1</mn></mtd> <mtd><mn>0</mn></mtd> </mtr> <mtr> <mtd><mn>0</mn></mtd> <mtd><mn>0</mn></mtd> <mtd><mn>1</mn></mtd> </mtr> </mtable> <mo>]</mo> </mrow> </math>