MathML Matrices



  • <mtable> tag is used to draw matrices or create tables. <mtable> is similar to table tag of HTML and this tag uses <mtr>, <mtd> elements which are almost like <tr> and <td> tags of HTML.

Syntax

<mtable> <mtr> <mtd></mtd></mtr></mfrac>

Example

  • Let's draw a 3 x 3 matrix.

Equivalent MathML Code

<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> 

Output

 output

Attributes

 Mathml Matrices

Mathml Matrices

  • Here is that the description of all the attributes of this tag −
    • align − Specify vertical alignment of the table . Valid values are: axis, baseline, bottom, center, top. Default is axis.
    • class, id, style − Used with stylesheets.
    • columnalign − Specify the horizontal alignment of 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 whole table. Valid values are: none, solid and dashed. Default is none.
    • framespacing − Specify additional space added between table and frame.
    • href − To specify hyperlink to 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 − Specify vertical alignment of the cells. Valid values 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 whole table.

Supporting Browsers

Element
<mtable> No No Yes No Only Basic Support


Related Searches to MathML Matrices