Open In App

HTML5 | MathML <mtable> Tag

The MathML <mtable> tag is used to create table or the matrices in HTML5. This tag is similar to the normal HTML <table> tag. The <table> has the <tr>, <td> and <td> tag, similarly it has the <mtr>, <mtd> and <mtd> tag, that act as same as those. But we don’t use the <table> and other sub tags to create the matrices. Here <mtable> is useful to create matrices. Because the MathML is all about the mathematical expression representation in HTML.

Syntax:  



<mtable attributes="value"> child elements </mtable>

Attributes: It accepts some attributes which are listed below:  

Note: There are few more attribute but those are not implemented yet like rowspacing, side, minlabelspacing, groupalign etc.
Below example illustrates the MathML <mtable> tag in HTML5:
 



Example:  




<!DOCTYPE html>
<html>
 
<head>
    <title>HTML5 MathML mtable tag</title>
</head>
 
<body>
    <center>
        <h1 style="color:green">
            GeeksforGeeks
        </h1>
 
        <h3>HTML5 MathML <mtable> tag</h3>
 
        <math>
            <mi>GeeksforGeeks</mi>
            <mo>=</mo>
            <mtable frame="solid" rowlines="dashed" align="axis 1">
                <mtr mathbackground="green;">
                    <mtd>Course</mtd>
                    <mtd>Fee</mtd>
                </mtr>
                <mtr>
                    <mtd>
                        <mi>C++ STL</mi>
                    </mtd>
                    <mtd>
                        <mi> 1499</mi>
                    </mtd>
                </mtr>
                <mtr>
                    <mtd>
                        <mi>Placement 100 </mi>
                    </mtd>
                    <mtd>
                        <mi>9999 </mi>
                    </mtd>
                </mtr>
                <mtr>
                    <mtd>
                        <mi>DSA Foundation </mi>
                    </mtd>
                    <mtd>
                        <mi>7999</mi>
                    </mtd>
                </mtr>
            </mtable>
        </math>
    </center>
</body>
 
</html>

Output:  

Supported Browsers: The browsers supported by HTML5 MathML <mtable> tag are listed below: 

 


Article Tags :