Open In App

HTML <colgroup> char Attribute

Last Updated : 07 Jun, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

The HTML <colgroup> char Attribute is used to set the alignment of the content in a column group in a character. It can only be used if the align attribute is set to "character". The default worth of char is that the decimal-point character of the page language.
Syntax: 
 

<colgroup char="character">


Attribute Values: 
 

  • character: It specifies the alignment of content to a character.


Example: 
 

html
<!DOCTYPE html>
<html>

<head>
    <title>
        HTML ColumnGroup char Attribute
    </title>

    <style>
        #myColGroup {
            background: green;
        }
        
        table {
            color: white;
            margin-left: 180px;
            background: yellow;
        }
        
        #Geek_p {
            color: green;
            font-size: 30px;
        }
        
        td {
            padding: 10px;
        }
        
        h1,
        h2 {
            text-align: center;
        }
    </style>
</head>

<body>

    <h1 style="color:green;"> 
        GeeksForGeeks 
    </h1>

    <h2> 
        HTML ColumnGroup char Attribute 
    </h2>

    <table>
        <colgroup id="myColGroup" 
                  span="3" 
                  align="char" 
                  char=".">
        </colgroup>

        <tr>
            <th>S.No</th>
            <th>Title</th>
            <th>Geek_id</th>
        </tr>
        <tr>
            <td>Geek_1</td>
            <td>GeekForGeeks</td>
            <th>Geek_id_1</th>
        </tr>
        <tr>
            <td>Geek_2</td>
            <td>GeeksForGeeks</td>
            <th>Geek_id_2</th>
        </tr>
    </table>
</body>

</html>

Output: 
 

Supported Browsers: No major browsers supported the <colgroup> char attribute. 


 


Next Article

Similar Reads