2024.11.23

以下实例是一个 2×2 矩阵,可以在 Firefox 3.5 以上版本查看到效果:

实例

<!DOCTYPE html>
<html>
   <head>
      <meta charset="UTF-8">
      <title>菜鸟教程(runoob.com)</title>
   </head>
       
   <body>
      <math xmlns="http://www.w3.org/1998/Math/MathML">
               
         <mrow>
            <mi>A</mi>
            <mo>=</mo>
                       
            <mfenced open="[" close="]">
                       
               <mtable>
                  <mtr>
                     <mtd><mi>x</mi></mtd>
                     <mtd><mi>y</mi></mtd>
                  </mtr>
                                       
                  <mtr>
                     <mtd><mi>z</mi></mtd>
                     <mtd><mi>w</mi></mtd>
                  </mtr>
               </mtable>
               
            </mfenced>
         </mrow>
      </math>
     
   </body>
</html>


使用第三方库来支持:

实例

<!DOCTYPE html>
<html>
   <head>
      <meta charset="UTF-8">
      <title>菜鸟教程(runoob.com)</title>
      <script type="text/javascript" src="https://static.jyshare.com/assets/js/mathml/mspace.js"></script>
   </head>
       
   <body>
      <math xmlns="http://www.w3.org/1998/Math/MathML">
               
         <mrow>
            <mi>A</mi>
            <mo>=</mo>
                       
            <mfenced open="[" close="]">
                       
               <mtable>
                  <mtr>
                     <mtd><mi>x</mi></mtd>
                     <mtd><mi>y</mi></mtd>
                  </mtr>
                                       
                  <mtr>
                     <mtd><mi>z</mi></mtd>
                     <mtd><mi>w</mi></mtd>
                  </mtr>
               </mtable>
               
            </mfenced>
         </mrow>
      </math>
     
   </body>
</html>


运行结果图,如下所示:

posted @ 2025-01-07 22:37  y龙  阅读(4)  评论(0)    收藏  举报