English 中文(简体)
MathML - Matrices
  • 时间:2024-09-17

MathML - Matrices


Previous Page Next Page  

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

    apgn − To specify the vertical apgnment of the table . Vapd values are: axis, basepne, bottom, center, top. Default is axis.

    class, id, style − Used with stylesheets.

    columnapgn − To specify the horizontal apgnment of the cells. Vapd values are: left, center and right. Default is center.

    columnpnes − To specify column borders. Vapd values are: none, sopd 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. Vapd values are: none, sopd and dashed. Default is none.

    framespacing − To specify additional space added between the table and frame.

    href − To specify a hyperpnk to a specified uri.

    mathbackground − To specify the background color. Vapd formats are #rgb, #rrggbb and html color names.

    mathcolor − To specify the text color. Vapd formats are #rgb, #rrggbb and html color names.

    rowapgn − To specify vertical apgnment of the cells. Vapd values are axis, basepne, bottom, center and top. Default is basepne

    rowpnes − To specify row borders. Vapd values are: none, sopd 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> 

Output

[ 1 0 0 0 1 0 0 0 1 ] Advertisements