Open In App

HTML | <colgroup> charoff Attribute

Last Updated : 04 Oct, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The HTML <colgroup> charoff Attribute is used to sets the number of characters that aligned the characters specified by the char Attribute. This attribute can only be used in the char attribute and align attribute is specified in the colgroup Element.

Syntax:

<colgroup charoff="number">

Attribute Values:

  • number: It contains the numeric value which specify the alignment.
    1. Positive values indicate the alignment to the right of the characters.
    2. Negative values indicate the alignment to the left of the characters.
        • Example:




          <!DOCTYPE html>
          <html>
            
          <head>
              <title>
                  HTML ColumnGroup charoff 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 charoff Attribute 
              </h2>
            
              <table>
                  <colgroup id="myColGroup" 
                            span="3"
                            align="char" 
                            char="." 
                            charoff="3">
                  </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: The browsers supported by HTML <colgroup> charoff Attribute are listed below:

          • Google Chrome Not Supported
          • Internet Explorer Not Supported
          • Firefox Not Supported
          • Apple Safari Not Supported
          • Opera Not Supported


          Like Article
          Suggest improvement
          Previous
          Next
          Share your thoughts in the comments

Similar Reads