MathML Matrices

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

MathML Matrices

In MathML, the element is used to create tables or matrices. The element contains only and elements. These elements are similar to , and

elements in HTML.

 

For example: To create a 3x3 matrix, having the following data:

Mathml Matrices 1

Equivalent MathML code:

  1. <math xmlns='http://www.w3.org/1998/Math/MathML' display='block'>  
  2. <mrow>  
  3.   <mo>[mo>  
  4.   <mtable>  
  5.     <mtr>  
  6.       <mtd>  
  7.         <mn>1mn>  
  8.       mtd>  
  9.       <mtd>  
  10.         <mn>0mn>  
  11.       mtd>  
  12.       <mtd>  
  13.         <mn>0mn>  
  14.       mtd>  
  15.     mtr>  
  16.     <mtr>  
  17.       <mtd>  
  18.         <mn>0mn>  
  19.       mtd>  
  20.       <mtd>  
  21.         <mn>1mn>  
  22.       mtd>  
  23.       <mtd>  
  24.         <mn>0mn>  
  25.       mtd>  
  26.     mtr>  
  27.     <mtr>  
  28.       <mtd>  
  29.         <mn>0mn>  
  30.       mtd>  
  31.       <mtd>  
  32.         <mn>0mn>  
  33.       mtd>  
  34.       <mtd>  
  35.         <mn>1mn>  
  36.       mtd>  
  37.     mtr>  
  38.   mtable>  
  39.   <mo>]mo>  
  40. mrow>  

 

Note: By default, an element has no borders at all. So, you have to add a containing a fence character (e.g. '[', ']', '(', ')', '|') before and after the when you specify a matrix or the determinant of a matrix.


MathML Matrix Attributes

Index Attributes Description
1) align It specifies the vertical alignment of the table with respect to its environment. Its possible values are: axis, baseline, bottom, center, top.
2) class, id, style It is provided for use with stylesheets.
3) columnalign It specifies the horizontal alignment of the cells. Its possible values are: left, center (default) and right.
4) columnlines It specifies column borders. Multiple values separated by space are allowed and apply to the corresponding columns (e.g. columnlines="none none solid"). Its possible values are: none (default), solid and dashed.
5) columnspacing It specifies the space between table columns.
6) displaystyle It refers 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.
7) frame It specifies borders of the entire table. Its possible values are: none (default), solid and dashed.
8) framespacing It specifies additional space added between the table and frame.
9) href It is used to set a hyperlink to a specified uri.
10) mathbackground It specifies the background color. You can use #rgb, #rrggbb and html color names.
11) mathcolor It specifies the text color. You can use #rgb, #rrggbb and html color names.
12) rowalign It specifies the vertical alignment of the cells. Multiple values separated by space are allowed and apply to the corresponding rows (e.g. rowalign="top bottom axis"). Its possible values are: axis, baseline (default), bottom, center and top.
13) rowlines It specifies row borders. Multiple values separated by space are allowed and apply to the corresponding rows (e.g. rowlines="none none solid"). Its possible values are: none (default), solid and dashed.
14) width It specifies the width of the entire table. It accepts length values.

Supporting Browsers:

Element chrome browser Chrome ie browser IE firefox browser Firefox (Gecko) opera browser Opera safari browser Safari
  Not Supported Not Supported Supported Not Supported Only Basic Support